I want to share how to build a string from compose outsput values in apply-to-each.
My scenario:
In Apply-to-each, create new value for each item,
After Apply-to-each, build a string by collecting new values.
Like, Get Database records, Create new digest title from each record, After send a summarize mail by collecting the new digest titles.
Sample:
1. Compose: "@CeateArray(1,2,3,4,5)"
2. Apply to each
2-1. Compose2: item
3. Compose:"@join(outputs('Compose2'), ',')"
Regards,
Yoshihiro Kawabata
Solved! Go to Solution.
Hi @yoshihirok,
Thanks for the sharing!
Appreciated.
Regards,
Michael
Hi @yoshihirok,
Thanks for the sharing!
Appreciated.
Regards,
Michael
Hi @yoshihirok,
I'm trying to build the workflow with quit the same funtionality, but every time I add a new action to join the texts, the "join action" wraps with "reapet with each" and as output I receive several join's. Could you suggest how to turn off auto addition of "repeat with each"?
Kind regards,
Mikhail
I've realized that Join action has some different use, so used Compose intiad and it worked.
Hi, @Anonymous
I will re-create new Flow in this Flow Build, and reply any result.
and I post a Idea related do it.
Append a string to string type variable
https://powerusers.microsoft.com/t5/Flow-Ideas/Append-a-string-to-string-type-variable/idi-p/46198
for more flexibility flow.
Regards,
Yoshihiro Kawabata
Hi @Anonymous
I don't understand your cause of problem,
Try Compose with Join expression instead of Data Operations - Join action.
Instead of any help, I post a flow on today created.
1. Trigger: Schedule - Recurrence
2. Action: Data Operations - Compose
Name = Compose
Inputs = [ CreateArray(1,2,3) ]
3. Apply to each
3-1. Action: Data Operations - Compose
Name = Compose 2
Inputs = [ item() ]
4. Action: Data Operations - Compose
Name = Compose 3
Inputs = [ Join(outputs('Compose_2'), ', ') ]
5. Action: Microsoft Teams - Post message
Message = [ Compose 3 - Output ]
This flow output "1,2,3".
-- [ <blue> ] is Expression.
-- [ <Purple> ] is Dynamic Content.
Regards,
Yoshihiro Kawabata
Hi @Anonymous
I post a idea related your problem.
"Data Operations - Join don't need 'Apply to each' flow. "
Yes, 'Data Operations - Join' does NOT need 'Apply to each'.
Workaround, Can you use 'Join' expression Instead 'Data Operations - Join'
Regards,
Yoshihiro Kawabata
Hi @yoshihirok,
Thank you so much. I appreciate you help.
Now I understand that Join action can't be used in this situation. This is nothing I can find about it in the documentation and in which cases it can be used for.
Kind regards,
Mikhail
Hi Yoshihiro
Thanks for the suggestion.
In some complex flow (with nested apply to each for example), using a compose defined inside a apply-to outside its scope is not allowed. For instance the compose 3-1 scope is only restricted 3. Using it in 4 does not work always (in my case with nested apply to each)
3. Apply to each
3-1. Action: Data Operations - Compose
Name = Compose 2
Inputs = [ item() ]
4. Action: Data Operations - Compose
Name = Compose 3
Inputs = [ Join(outputs('Compose_2'), ', ') ]
With the recent support for "Append to Array variable" action, we can perhaps replace this with a different flow
2. Initialize TemporaryArray - array variable
3. Apply to each
3-1 Action: Append to array variable
Name= TemporaryArray
Value= [ item() ]
4. Compose
Expression: Join(variables('TemporaryArray'),';')
5. result we need is in Output('Compose')
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
14 | |
14 | |
10 | |
7 | |
6 |
User | Count |
---|---|
20 | |
16 | |
9 | |
9 | |
8 |