cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jayant_ab
Frequent Visitor

Using Compose array in apply to each

Hi All,

i have a simple workflow to achieve something basic. I have a sharepoint list in which a title column is present. The title column conatins email id concatenated by ';' (ex: 'abc@gmail.com;xyz@gmail.com').
Now i am trying to find the user id of those emails through power automate. I am stuck on how to separate out these email ids so that i can use those in get user profile action in power automate.

Currently i am using the split function and below is the code.

split(triggerOutputs()?['body/Title'],';')


below is the output of the compose

jayant_ab_0-1644926009368.png

now i would want to get the user id of each of these email ids through get user profile action for which i have an apply to each and i use that action within that apply to each with compose action outputs but it sends out two emails rather than 1 and thus the action fails.

How can i achieve this, please help?

jayant_ab_1-1644926118553.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jayant_ab
Frequent Visitor

Well, i found the solution for it. I used a select statement after the compose and assigned email column with value from compose output and then in the apply to each i used select statement outputs and within the get user profile i used Items('Apply_to_each')?['email'] and it worked like a charm

View solution in original post

3 REPLIES 3
jayant_ab
Frequent Visitor

Well, i found the solution for it. I used a select statement after the compose and assigned email column with value from compose output and then in the apply to each i used select statement outputs and within the get user profile i used Items('Apply_to_each')?['email'] and it worked like a charm

powerpanda
Helper III
Helper III

Hello Jayant,

 

I made a flow using your data. I was able to use apply to each with your data. I have attached the screenshot. Can you try the below steps:

1) Initialize an Array Variable: Use your split -  split('abc@gmail.com;xyz@gmail.com',';')

2) Parse the array: 

{
    "type""array",
    "items": {
        "type""string"
    }
}
3) Then you should be able to find items as your email address.
 
See my  result below;
powerpanda_1-1644929260596.png

 

 

 

 

powerpanda_0-1644929081320.png

 

powerpanda
Helper III
Helper III

Hello Jayant,

 

I made a flow using your data. I was able to use apply to each with your data. I have attached the screenshot. Can you try the below steps:

1) Initialize an Array Variable: Use your split -  split('abc@gmail.com;xyz@gmail.com',';')

2) Parse the array: 

{
    "type""array",
    "items": {
        "type""string"
    }
}
3) Then you should be able to find items as your email address.
 
See my  result below;
powerpanda_2-1644929293402.png

 

 

 

 

 

powerpanda_3-1644929293411.png

 

 

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,274)