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 / Combine strings only w...
Power Automate
Unanswered

Combine strings only within apply to each

(0) ShareShare
ReportReport
Posted on by 14

Hello,

 

I'm struggling getting something to work correctly and I'd like to find a solution with you.

 

I have a flow which gets folders within a document library to check whether users have uploaded the right document or not. Each folder has its own user and they all need to upload a file and enter a category value (which is a choice column in the library). If they haven't uploaded the correct file at a certain time of the month, they get a reminder email.

 

As you will see from the screen capture, I have an apply to each for folders that sends an HTTP request to SP to get the number of files for each folder, so I know if they have uploaded at least one file. If they haven't they get a notification, and if they have, I then have another apply to each for files that gets the category value for each file, combine all those values together and I then have a condition to check whether the correct value is there or not and a notification is sent.

 

The problem I have is that when I combine all strings, the function doesn't take into account the apply to each folder in which it is. It simply combines ALL strings, whatever the folder. So obivously the rest of the flow is not correct.

 

Is there a way to combine strings from within an apply to each or is there maybe another way to build this flow? FYI, I combine strings so users get only one notification even if they uploaded multiple files because I only need to check if at least one file has the correct category.

 

Many thanks.

Region-Flash-2.jpg
Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,755 Most Valuable Professional on at

    Hi @max351,

     

    I see you are using an append to string variable. Which means every single loop it will add more string to the string variable.

     

    Maybe you can reset that string variable at the end of your loop by using a set variable action with a value of "" or null?

  • max351 Profile Picture
    14 on at

     Hi, thanks for your reply. Well, you're right, maybe I shouldn't have used the append to string variable in the first place. I put a set string variable instead and it seems to work fine even though I'm not sure exactly why. 😁

  • Expiscornovus Profile Picture
    33,755 Most Valuable Professional on at

    Hi @max351,

     

    With a set variable in every loop you will update the value of the variable, overwriting the current value of it. 

  • max351 Profile Picture
    14 on at

    Hi @Expiscornovus,

     

    OK, but will that work? I would like to get all category values from all files within a folder and check whether at least one of those file has this value. If none, then I send the reminder email, if at least one has, then we're good and nothing happens.

    When I used append to string variable, the problem was that I got asa many reminder emails as there were files with the expected category value. Now with the set string variable, it appears to be working since I only get 1 email even if there are multiple files, but once again, I'm not 100% sure since it's not in production.

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard