cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
skarthanal
Helper III
Helper III

How to get and create separate variable from an apply to each step

Hi everyone!  What i am trying to accomplish is create 3 variables from an apply to each step in PA.  I have a field in SharePoint that is a people picker which would be a list of approvers.  A user would enter those approvers and in PA i would like to create 3 variables: Approver1,2,3.

 

I have gotten to the point where the apply to each works and returns the 3 people and their email addresses but i am stuck on how to create 3 seperate variables from that apply to each.  I would like to extract the individual email addresses from those 3 approvers and send them seperate emails.  Thanks in advance.

 

flow 1.jpgflow2.jpg

1 REPLY 1
Pstork1
Dual Super User
Dual Super User

Create a string or object array variable to hold the user objects or email strings.  Then use the Append to array action inside the loop to append a new array entry to the end of the variable.  Then you can either use a combination of First(LastN()) or access the array entry directly using JSON notation.  For a string variable called test you would get the second element using this JSON

variables('test')[1]


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (5,168)