cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vbvbvb
Microsoft
Microsoft

Use SPO Get Items to build string variable from all list entries

Hi all, just want to check if this is viable scenario - if we take a SPO list with 2 columns: "user name" and "email", for example:

 

Column SPOName: John Doe , Jane Doe 

Column SPOEmail: john.doe@contoso.com, jane.doe@contoso.com

 

  1. Initialise string variable ListItems
  2. Get items - point to SPO list;
  3. Apply to each > Set Variable ListItems with value:   "SPO name  - <at>SPOEmail</at>, "
  4. Use ListItems as dynamic content to insert into adaptive card.

It works fine but in the final card, only 1 entry is getting added, while Flow run showing list of these values:

 

Capture.PNG

 

And final result is just "Jane Doe - @Jane.doe@contoso.com".

How to make all "Apply to Each" variable results to be output into continuous text string like : "Jane Doe - @Jane.doe@contoso.com, John Doe - @John.doe@contoso.com,"?

I suspect that some Compose action is needed but what would be espression to add all these variables in the string?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User III
Super User III

Hi!
You can either use 'Append to string' variable
or
Declare your variable as Array, use 'Append to Array', and once 'apply to each' is finished, convert it into a string by means of join() function
More info here
https://powerusers.microsoft.com/t5/Building-Flows/Put-spaces-between-people-names/td-p/506563
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

4 REPLIES 4
efialttes
Super User III
Super User III

Hi!
You can either use 'Append to string' variable
or
Declare your variable as Array, use 'Append to Array', and once 'apply to each' is finished, convert it into a string by means of join() function
More info here
https://powerusers.microsoft.com/t5/Building-Flows/Put-spaces-between-people-names/td-p/506563
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

So if I want to use Append to String, how does the logic works here:

 

Capture2.PNG

Does it stay inside Apply to each? I tried that now - doesn't seem that it likes the output already inside the adaptive card.

Hi!
I an afraid It's difficult to suggest anything without having context info about the adaptive card design
Please share Adaptive Card json definition if possible
Thanx!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



I guess i just have to use Compose with append to string variable results and then use these in adaptive card body where i want these text strings to be inserted?

 

UPS: Yup, that solved it 🙂 Thanks for valuable advice!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,478)