I have a string containing placeholder text that I want to dynamically replace in a single action. Here is fake text as an example:
"This [Product]'s dimensions are [Dimensions]."
If this were an Excel file, I would create a table as follows:
I assume I will need some kind of Apply to Each loop that operates over an array containing the table above or something like that, but I have no idea where to start.
it all depends how you are getting the data, so for an example if you will get data as an array or collection you can add "Apply to each" action in flow and use following expression (sample) in 'compose':
concat('This ',items('Apply_to_each')['Product'],' dimensions are ', items('Apply_to_each')['Dimensions'])
above expression output will be like - "This cabinet dimensions are 10x10"
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
@DeepakS , thank you for your reply. The text in question is coming from a SharePoint list, so concatenation is out. I know I will need to use some kind of Replace action. The path I am trying to pursue is having a SharePoint list that maps the placeholders to the corresponding column titles in a second SharePoint list like below:
What I want to do is a replace in an Apply to Each that loops through the list of placeholders (LISTA.Placeholder) and replaces them in the text string with the value in the column in LISTB specified by the LISTA.Mapping column.
For example, if the Apply to each is on the [Product] placeholder, it replaces the placeholder with the value in the Dimensions column in LISTB because that is where I have mapped the placeholder in LISTA.
I hope all of that makes sense. Finding it difficult to explain my goal.
Perhaps a better question for this post would be "How do I dynamically specific which column I want to pull a value from in a SharePoint list?"
Hi @dehmos27 , I may be little confuse, could you please share a sample final result that you are trying to get after all mapping?
Are you trying to get something like this?
Hope I haven't misunderstood but within SharePoint you can have a calculated column with a formula of:
=CONCATENATE("This ", Product," dimensions are ",Dimensions)
This will show as "This Cabinet dimensions are 10x10" requiring no Power Automate as the column will update every time you update the item.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.