Hello, I am bit stuck here. I am hoping if any one here can assist me on this issue.
User case:
I have a SharePoint list "JobTitleList" that has a Single line text column called "RecipientPosition". The item stored in that column is users job title separated with semicolon " ; ". See the snap shot below.
I have another list "MainList" that stores the users email from there job title in a people picker column by using power automate. "Allow multiple selection" is enable in the people picker column. See snapshot below.
I was able to get the users detail by there Job title using Microsoft Graph API. But I was not able to associate each user jobtitle to the the recipient people picker column in another list. Here is what I did to get those values. See the screen shot below as well.
- I Used Get Items trigger to get the "RecipientPosition" from the List
- Separated the users job title using split function to get each job title from the list which created an Apply to each Loop.
- Created a compose trigger to store each job title value in another Apply to each loop, which is nested under the first apply to each loop.
- In the nested apply to each loop:
- I invoked an HTTP Request to get the users detail by there job title
- Mapped to get "userPrincipalName" from the body of the HTTP Request.
- Used the first funtion to get the object from an array
- Append to each array on the nested apply to each loop.
- And Here is where I am Stuck??
- For Each loop on Nested Apply to each loop, I want to get only one value and append that value to the parent apply to each loop. so that I can add those users email in the people picker column
- Currently, the Append to each loop on the First loop "Apply to each 9", I am getting the repetative value of Nested loop.
I hope this diagram might help to understand. I think my explanation might be complicated to understand.
1 is First Loop Apply to each 9
2 is nested loop under Apply to each 9
The below snap shot is inside the "Parent Loop Apply to each 9" On this section, Since I am using Append to array trigger, its appending the duplication values from nested loop. Example,
First Parent Apply to each 9 loop give me two values,
[
{"Claims": "UserEmail1"},
{"Claims": "UserEmail2"}
]
The second loop with in Apply to each 9 loop gives me 4 values including the values of 1st loop.
[
{"Claims": "UserEmail1"},
{"Claims": "UserEmail2"},
{"Claims": "UserEmail3"},
{"Claims": "UserEmail4"}
]
How would I remove the duplication values from the loop so that I can get unique value for each loop?
I took me while to formulate this question. Don't know if I made my statement clear. But I am looking to see if any one can help me out here.
Thanks

Report
All responses (
Answers (