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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 707

#2
Haque Profile Picture

Haque 475

#3
Valantis Profile Picture

Valantis 456

Last 30 days Overall leaderboard