I think I'm missing something that feels like it should be simple.
I have a Flow that's going out and getting group membership. Once it does, I'm selecting a few fields from those members and then using compose, with the output from my select step as the input for my compose step. When I put that output in an email, it formats like the following:
[{"Value1":"Value2"},{"Value1":"Value2"}]
I'd like to at the very least be able to have each record display on a separate line. If there's a way to remove the output formatting, that would be nice too. So something more like:
Value1 - Value2
Value1 - Value2
Solved! Go to Solution.
Hi @jp17,
Could you please share a screenshot of your flow's configuration?
I have made a test on my side and please take a try with the following workaround:
string(item())
Add a "Compose 3" action, Inputs set to following formula:
indexOf(outputs('Compose_2'),':')
Add a "Compose 4" action, Inputs set to following formula:
indexOf(outputs('Compose_2'),'}')
Add a "Compose 5" action, Inputs set to following formula:
substring(outputs('Compose_2'),2,sub(outputs('Compose_3'),3))
Add a "Compose 6" action, Inputs set to following formula:
substring(outputs('Compose_2'),add(outputs('Compose_3'),2),sub(sub(outputs('Compose_4'),1),add(outputs('Compose_3'),2)))
Add a "Compose 7" action, Inputs set to following formula:
concat(outputs('Compose_5'),' - ',outputs('Compose_6'))
Add a "Compose 8" action, Inputs set to following formula:
Note: Within Inputs field, fill the output of "Compose 7" action in first line, then fill the FinalString variable in the second line.
Add a "Set variable" action, Name choose FinalString and Value set to output of "Compose 8" action.
The output of the "Compose" action as below:
Image reference:
The flow works successfully as below:
Best regards,
Kris
Hi @jp17,
Could you please share a screenshot of your flow's configuration?
I have made a test on my side and please take a try with the following workaround:
string(item())
Add a "Compose 3" action, Inputs set to following formula:
indexOf(outputs('Compose_2'),':')
Add a "Compose 4" action, Inputs set to following formula:
indexOf(outputs('Compose_2'),'}')
Add a "Compose 5" action, Inputs set to following formula:
substring(outputs('Compose_2'),2,sub(outputs('Compose_3'),3))
Add a "Compose 6" action, Inputs set to following formula:
substring(outputs('Compose_2'),add(outputs('Compose_3'),2),sub(sub(outputs('Compose_4'),1),add(outputs('Compose_3'),2)))
Add a "Compose 7" action, Inputs set to following formula:
concat(outputs('Compose_5'),' - ',outputs('Compose_6'))
Add a "Compose 8" action, Inputs set to following formula:
Note: Within Inputs field, fill the output of "Compose 7" action in first line, then fill the FinalString variable in the second line.
Add a "Set variable" action, Name choose FinalString and Value set to output of "Compose 8" action.
The output of the "Compose" action as below:
Image reference:
The flow works successfully as below:
Best regards,
Kris
To get each field on a separate line I add this expression between each field:
concat(' ','</br>')
How can you get this working for a multipart list into something plain text format? This would have worked great when I sent as email but now that I'm working in planner the format is all over the place and only works on the first part of the entry.
Hello thanks for your post
but am getting error .. Please help me understand why this is happening
Someone pointed this post out when they were looking for a solution to what they were after. If anyone's interested, this is how I would have built the flow in this scenario.
See full flow below. I'll go into each of the actions.
List group members retrieves the members from the group specified.
Select user the output from List group members and maps the concatenation of relevant properties. The expression used is below. Note that Map is using Text mode (see screenshot).
concat(item()?['displayName'], ' - ', item()?['jobTitle'])
Send an email uses the following expression to join each of the items in our Select with a <br> tag so they display on a new line. The expression used is:
join(body('Select'), '<br>')
The output of the email would look like the following.
----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.
User | Count |
---|---|
95 | |
45 | |
21 | |
18 | |
17 |
User | Count |
---|---|
142 | |
50 | |
43 | |
40 | |
31 |