はじめに
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
)