1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Power Apps複数行テキストの改行や空白をPower Automateで保持する方法

Posted at

やりたいこと

下図のような複数行テキスト(リッチテキストではなくプレーンテキスト)をPower Automateを使ってメールやTeamsで改行や空白を保持したままにしたい!
image.png

方法

例えば下図のようなフローで、
image.png

Composeアクションで↓をすればOK。

uriComponentToString(
    replace(
        replace(
            replace(
                uriComponent(triggerBody(['text']),
                '%0D%0A','<br>'
            ),
            '%0A','<br>'
        ),
        '%0D','<br>'
    )
)

コピペ用

uriComponentToString(replace(replace(replace(uriComponent(triggerBody()['text']),'%0D%0A','<br>'),'%0A','<br>'),'%0D','<br>'))

%0D%0A%0D%0Aの改行コードをHTMLの改行コード<br>に変換している。

最後にメールやTeams等へ出力する際に<pre> </pre>で囲んであげると空白も保持される。

謝辞

こちらの記事を参考にさせていただきました。ありがとうございます!

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?