web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to stop apply to e...
Power Automate
Unanswered

How to stop apply to each and get single value in power automate flow?

(0) ShareShare
ReportReport
Posted on by 127

I have spend the whole day to fix the problem.I  am generating  pdf report using html and power automate.

now I have faced a problem of looping while I only need a single value:

as I tried to explain on the image below, the column Voucherno and Location are located in the same sharepoint list, I want only a single value of them based on my condition. if i remove them the flow  works fine, but I need them.

The moment I try to append a variable, automatically they  apply to each is added , that means they become loop.

help me how to get a single value in such cases.

hovloop.png

Categories:
I have the same question (0)
  • Verified answer
    HenWang Profile Picture
    Microsoft Employee on at

    Hi @Sebey ,

     

    I suppose your Voucherno and Location dynamic contents are from the SharePoint “Get items” action. In this scenario, the “Get items” action will return an array value and this is why power automate automatically generates an “Apply to each” outside your “append to string variable” action.

     

    In my test, I have a list with only one item, even in this case, power automate will generate the “Apply to each” action as well. Basically, if your “Get items” action only returns one row, it would be fine even if the flow is adding the “Apply to each” action, because it will only run for once and it will use the single value as expected.

     

    However, if your “Get items” action returns more than one row, you will need to use the filter query in your “Get items” action to make sure this action will only return the single row that will be used in the “Append to string variable” action.

     

    For example:

    My list:

    HenWang_0-1683252909806.png

    Then in my Get items action’s Filter query:

    HenWang_1-1683253108710.png

     

    Query Schema:

    column_name eq '(the value)'

     

    Flow will only return the row with title value equal to “dd”, it’s one single row which would be fine with the “Apply to each” action.

     

    Or, if you don’t want to do the filter query, then you will need to use the expression to get the specific single item to avoid the “Apply to each” action:

     

    For example: (still using the same list above)

     

    I want to append the “Title” value from my second item:

    HenWang_2-1683253203851.png

     

    Expression in "Append to string variable" action :

    HenWang_3-1683253337753.png

    outputs('Get_items')?['body/value'][1]['Title']

     

    So, please feel free to let me know if you still have question related to my above answer, I would be glad to help further if the situation is different from your side.

     

    Best Regards,

    Hen Wang

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard