I have an array of items that I need to convert into a string. I need the text to go into a plain text email form which is submitted into our ticketing system.
I've tried various `join` and `concat` options but can't get the result I expect. The data comes from a multiple entries group/person field from SharePoint via a PowerApps form. I have transformed the data to an array, but this is where I am stuck.
I want to go from this:
[ { "DisplayName": "Bob Jones", "Email": "bob.jones@example.com", "JobTitle": "Singer" }, { "DisplayName": "Jane Doe", "Email": "jane.doe@example.com", "JobTitle": "Lighthouse Painter" } ]
To this:
Bob Jones - bob.jones@example.com - Singer Jane Doe - jane.doe@example.com - Lighthouse Painter
Any help appreciated
Solved! Go to Solution.
Hi @IntrepidExploer,
I have made a test on my side and please take a try with the following workaround:
concat(item()?['DisplayName'],' - ',item()?['Email'],' - ',item()?['JobTitle'])
Add a “Compose 2” action, Inputs field set to following formula:
Note: Within Inputs field, type Output dynamic content of “Compose” action in first line, then type variable FinalString in second line (type “Enter” key in your keyboard).
Add a “Set variable” action, Name choose FinalString and Value set to output of “Compose 2” action.
Image reference:
The flow works successfully as below:
Best regards,
Kris
Hi @IntrepidExploer,
I have made a test on my side and please take a try with the following workaround:
concat(item()?['DisplayName'],' - ',item()?['Email'],' - ',item()?['JobTitle'])
Add a “Compose 2” action, Inputs field set to following formula:
Note: Within Inputs field, type Output dynamic content of “Compose” action in first line, then type variable FinalString in second line (type “Enter” key in your keyboard).
Add a “Set variable” action, Name choose FinalString and Value set to output of “Compose 2” action.
Image reference:
The flow works successfully as below:
Best regards,
Kris
Hi @v-xida-msft,
Thanks for your help. That's an excellent solution. I really appreciate the time you put into producing that example.
Cheers.
Just what I needed. Awesome solution. Thanks a lot..
Can this work for a Sharepoint List?
for example I have two emails seperated in items in a List. I want to join (Concat) the emails together to send a approval to multiple people base of the Sharepoint list. Im trying with Get Items but i don't seem to get it. Im new with Microsoft Flow
Thanks
hi @v-xida-msft
I have somewhat similar requirement but cannot go through it with your current solution.
I have this as my original array:
[
{
"Field 1": "Value 1.1",
"Field 2": "Value 1.2",
"Field 3": "Value 1.3",
"Field 4": "Value 1.4"
},
{
"Field 1": "Value 2.1",
"Field 2": "Value 2.2",
"Field 3": "Value 2.3",
"Field 4": "Value 2.4"
}
]
Initially, I want to send an email containing the array which I have transformed to HTML Table like this:
Field 1 | Field 2 | Field 3 | Field 4 |
Value 1.1 | Value 1.2 | Value 1.3 | Value 1.4 |
Value 2.1 | Value 2.2 | Value 2.3 | Value 2.4 |
But as it turned out, the table layout is to tight because my table has too many columns to fit in a HTML view. So I decided to transform the layout into something like this:
Field 1: Value 1.1
Field 2: Value 1.2
Field 3: Value 1.3
Field 4: Value 1.4
Field 1: Value 2.1
Field 2: Value 2.2
Field 3: Value 2.3
Field 4: Value 2.4
but I cannot figure out how to transform the original array.
Appreciate if you can look into it and help. Many thanks.
Is it possible to skip lines for each string?
Is it possible to skip lines for each string ?
Thank you so much for posting this; it worked perfectly!
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
38 | |
24 | |
21 |