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 array values and...
Power Automate
Unanswered

Check array values and return the index of specific value

(0) ShareShare
ReportReport
Posted on by 36

Hi, 

Can anyone please help me with this? 

 

I'm trying to check an array in Power Automate whether it has a number or not, and return its index. The array is received from powerapps as a string and the number of elements is not fixed, but it could have one numeric value. 

 

some examples of the arrays the flow might receive from powerspps

["","","200",""]

["","",""]

["","400",""].

 

 

The flow I need to make should check first if the array has a numeric value or not, and if it does, the flow should return its index and a variable. 

 

any thoughts? 

 

Categories:
I have the same question (0)
  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Hello @OmarSaleh 

     

    This is what the flow could look like:

     

    Matthy79_1-1703359513778.png

     

    1. Use json function to transform your parameter into an array.
    2. Use select to create your index. index = item() and value = 
      outputs('Compose_string_array')[item()]
    3. Use filter array to only get those elements that has a numeric value
    4. Respond to your app using this formulas:
      if(empty(body('Filter_index')), false, true)
      coalesce(first(body('Filter_index'))?['value'], -1)

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