Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

set variable from get items result to avoid apply to each

My flow is creating a Sharepoint item and I have the get items function finding an email to add to a text field in my Sharepoint item. It works beautifully except when I add the field i obtained from "Get Items", an "Apply to Each" is added, which then duplicates my Sharepoint entry. How can I save my get items result as a variable so that I can avoid the "Apply to Each" from being added?

Dual Super User III
Dual Super User III



The "Get Items" action gets youa list of items and adding anything from this output will be under an apply to each control. Yo need to add a unique identifier to get the particular record: 

1. Create an array variable and iterate through to find the particular record

2. Instead of Get Items, use Get Item with the appropriate identifier. 


Hope this helps!


If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS! 

Solution Sage
Solution Sage

Hi @kels89 ,

Could you please share a screenshot of your flow's configuration?

It seems you want to get the data from one list, then create new item in another list.

Could you please provide more details about your scenario?

As @yashag2255  said, if you want to get the specific item data, you can use the 'Get item' action.

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Is there a way to add a filter query to get item? If I can get that to work, then I think it will be doable but I'm not seeing the filter query option.  



@v-zhos-msft  & @yashag2255  See my flow, above! I have created a request off flow and I am trying to pull two different items from the same list of users: a requestor and a covering provider.  I have Get Items working using a condition for the requestor name. However, I also need to pull in the covering provider that matches the name the user put in the form. This is where I'm getting stuck. I tried Get Items but I need help converting it to a variable so that it doesn't add an apply to each and duplicate the "Create Item". Get Item doesn't allow me to add a filter query.




Hi @kels89 ,

As the pic shown, you used the 'Filter Query' to get the item which  the provider equal to the user put in the form.

Whether the action will return multiple items or just one item.

If the action just returned a specific item, I think you don't need mind the 'Apply to each'.

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-zhos-msft, The filter query is only returning one item, however, flow is still requiring I add an apply to each when I add that field in my sharepoint list, which then duplicates the entry. That's why I believe I have to convert it to a variable to add it into the Create Sharepoint Item action.

Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (9,115)