ホーム › フォーラム › Power Automate › 初心者向け › 文字列操作に関して
-
投稿者投稿
-
2019-07-26 12:12 #4418Hiro #PowerAddictキーマスター::
はじめまして。Flowの中で、長い文字列(htmlファイルの中身全部)があった場合、特定も文字列間の要素のみ抽出という操作はどのように記述すればよいでしょうか?
<div class="aaa">..... <div class="bbb">....
となっていた場合に、
<div class="aaa">
と<div class="bbb">
の間の文字列を抽出したいと思っています。
Splitだと、Splitした結果のN番目をさらにSplitして…と繰り返しになるので、もし他に簡潔な関数があれば教えてください!- このトピックはHiro #PowerAddictが4年、 9ヶ月前に変更しました。
- このトピックはHiro #PowerAddictが4年、 9ヶ月前に変更しました。
2019-07-27 23:46 #4427馬場拓真(@taku_ma_ru)キーマスター2019-07-28 18:49 #4431Hiro #PowerAddictキーマスター2019-12-08 17:55 #5056だい³参加者::こんにちは
私もコミュニティに参加・貢献したくて初返信させていただきます!
(全然見当違いな内容だったら恐縮ですが・・・)以前、xmlの中身を解析・内容を取り出したくて、xpathという関数を利用したことがあります。
HTMLもXMLの一種として扱えるのであれば、取得できるのではないかな?と思っています。※この時は気象庁が公開している地震情報を解析したくてテキストを取得していました。
xpath(xml(body(‘HTTP’)),’//*[local-name()=”Report”]/*[local-name()=”Control”]/*[local-name()=”Title”]/text()’
上記の関数で、「震源に関する情報」という文字列を取得しています。以下は抜き出したいhtmlの一部です
<Report xmlns=”http://xml.kishou.go.jp/jmaxml1/” xmlns:jmx=”http://xml.kishou.go.jp/jmaxml1/”>
<Control>
<Title>震源に関する情報</Title>
<DateTime>2019-08-03T18:07:12Z</DateTime>
<Status>通常</Status>
<EditorialOffice>気象庁本庁</EditorialOffice>
<PublishingOffice>気象庁</PublishingOffice>
</Control>
・・・以下省略・・・2020-11-11 13:57 #5649shimo参加者::Onedriveにあるエクセルファイルにテーブルを作成し金額項目に金額を設定しました。
テンプレートの行の取得で、金額項目の値を取得し、integerの変数Aと比較しましたが、
フローに失敗しました。
原因は、関数呼び出しで指定した値はString型とInteger型が不適合ですというものでした。
エクセルにあるテーブルの値をString型として取得する方法はありますか?
また、大小比較をStringとしておこなう方法はないでしょうか?
教えていただきたく思います。
よろしくお願いいたします。
英訳ーー
I created a table in an excel file in Onedrive and set the amount in the amount item.
In getting the row of the template, I got the value of the amount item and compared it with the variable A of the integer,
The flow has failed.
The cause was that the value specified in the function call was incompatible with the String and Integer types.
Is there a way to get the value of the table in Excel as a String type?
Also, is there a way to compare the size as a String?
I would like to know.
Thank you.
2020-11-23 12:04 #5676だい³参加者::Excelファイルから取得しを金額項目を、int関数で数値に変換し比較してみてはどうでしょうか?
int関数であれば文字列を数値に変換できるのではと思っています。int関数(Docs)
https://docs.microsoft.com/ja-jp/azure/logic-apps/workflow-definition-language-functions-reference#int>大小比較をString
こちらは具体にどのような比較になりますか? -
投稿者投稿
- このトピックに返信するにはログインが必要です。