Using Replace Function with Dynamic Content

Options

I am building a flow where I am bringing content in from a text file saved on SharePoint. I want to replace a specific part of the text with dynamic content saved within a string variable, previously initialized within the flow. I am using a Compose action with a Replace Expression to try to accomplish this. Below is an example of the replace function I have tried to add to the Compose action input with no avail - PA keeps preventing with an error “The expression is invalid”. Please take a look at the expression below and let me know what I am missing. Thank you!

replace(outputs('Compose_Content'), 'CURRENT MONTH', 'variables('Current_Month')')


Comments

  • Hi Austen,

    Your replace function looks like the last argument is in single quotes, when it is a variable not a string.

    Instead of this:

    replace(outputs('Compose_Content'), 'CURRENT MONTH', 'variables('Current_Month')')

    Try this:

    replace(outputs('Compose_Content'), 'CURRENT MONTH', variables('Current_Month'))

  • Austen Brown
    Austen Brown Community All-Star
    Ninth Anniversary Kudos 5 Name Dropper Participant

    @Evan Webb - I knew it was something small… your suggestion worked! Thank you so much!

Categories