0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PADとPower Fxで複数プレースホルダーをSubstitute関数で置換する

0
Posted at

はじめに

Power Automate Desktopで、Power Fxを有効化している場合、テンプレート文字列の {0}、{1}、{2} などのプレースホルダーに値を差し込みたいことがあります。

そのような場合は、Substitute関数を使うことで置換できます。置換箇所が複数ある場合は、Substituteをネストして順番に置換していけば対応可能です。

以下は、Power Fxでそのまま使えるコピペ用の例です。

1回置換する場合

=Substitute(
    strTemplate,
    "{0}",
    strValue0
)

2回置換する場合

=Substitute(
    Substitute(
        strTemplate,
        "{0}",
        strValue0
    ),
    "{1}",
    strValue1
)

3回置換する場合

=Substitute(
    Substitute(
        Substitute(
            strTemplate,
            "{0}",
            strValue0
        ),
        "{1}",
        strValue1
    ),
    "{2}",
    strValue2
)
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?