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 / Check if an item exist...
Power Automate
Unanswered

Check if an item exists in array

(2) ShareShare
ReportReport
Posted on by 12

Hi I am trying to Build a flow, in part of the flow I need to check if an item exists in an array. Is it possible to do this?

my only problem is to check if exist in the array

the following shows my workflow:

2019-03-12_12-18-09.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yamao-msft Profile Picture
    on at

    Hi @EhsanAliverdi ,

     

    To check if an item exists in an array, please check the following flow for a reference.

     

    In my scenario, I am going to check if a button input exists in an array. If Yes, do nothing. If no, add the item to the list.

    1.PNG2.PNG

     

    Best regards,

    Mabel

     

  • mboonie Profile Picture
    164 on at

    Hi. I have a question  about what might be the most efficient way to check whether a value exists in an array. Two straighforward approaches, it seems are these:

    • Loop through the collection and check each element, either setting a flag (e.g. blnValueFound = true), or concatenate the values and check the string (as above).
    • Apply a filter to the collection and then check whether it's empty.

    Does anyone know which is the best approach in terms of speed and resources?

     

    Thanks.

  • Community Power Platform Member Profile Picture
    on at

    I use a Compose where I store my triggerbody() array. In my example, I get one or more IDs by the triggerbody() separated by a comma. Then, to avoid the error, I check if it's empty. If so, I store an empty Array('') in my Compose; otherwise, I store the triggerbody() response. After that, I'll continue my flow with the array empty or not.

     

    2021-08-30_20-15-40.png 

     

    For what it's worth

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard