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 Automate
Unanswered

personal variables

(0) ShareShare
ReportReport
Posted on by 44

Can we define a string array to be used in a for-each or do loop process in flow.

 

Let say defining a list of keywords to look up in messages content (azure, migration, 365, google, ...).

Once the keyword is found, msg should be stored in the keyword folder.

 

This will avoid a bunch of branches and allow to add keyword without modifyin the flow.

 

Apologies if this question was already asked but did not find it in the forum and i'm new using Flow

 

Rgds

Eric

Categories:
  • Pawel Profile Picture
    Microsoft Employee on at

    Hi @DarkEric,

    what is exactly your scenario?

     

    In general it's possible to check if one of the strings in an array filfills a condition. For that you would need to use "Add a condition" option and then select "Edit in advanced mode". In advanced mode you need to add a condition based on Workflow Definition Language

     

    E.g. below is the condition to check if the subject of a new email contains any of the strings from array ['azure', 'o365', 'microsoft'] 

     

    @or(contains(triggerBody()?['Subject'], 'azure'),or(contains(triggerBody()?['Subject'], 'o365'), contains(triggerBody()?['Subject'], 'microsoft')))

    See screenshot below:

     

     Capture.PNG

     

    Let me know if that helps.

     

  • DarkEric Profile Picture
    44 on at

    Pawel,

     

    Thx for your reply.

     

    It covered part of it, yes.

    ideally wishing to avoid a lot of "and" in the test condition that why i thought to a "for each" or a "do loop" with a string array or equivalent as {'string1', 'string2'} and a "is in" condition.

     

    as an example, let say that you have to follow some projects (some could vary from 1 to x) and you want to automatically store msg in the project folder pointed by the string you detect in the body.

     

    So once you have defined the project list array, the flow scan new msg to look if any of string is detected; if one is detected the string is used to define the storage folder.

     

    hope my explanations are clear enough.

     

    Rgds

    Eric

     

     

  • Pawel Profile Picture
    Microsoft Employee on at

    @DarkEric currently we don't have a condition similar to "is in array" that you mentioned.

    As a workaround you can use solution that I suggested in my previous post using Workflow Definition Language (but I agree, the condition might become lenghty and the user experience of adding such condition should be improved).

     

    Could you add your idea to our Flow ideas page? https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard