cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Dual Super User III
Dual Super User III

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

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
Highlighted
Dual Super User III
Dual Super User III

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

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

Highlighted
Microsoft
Microsoft

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

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.

Highlighted
Dual Super User III
Dual Super User III

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

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!



Highlighted
Microsoft
Microsoft

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,379)