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 Apps / Compare number to arra...
Power Apps
Answered

Compare number to array of numbers

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to build an app that lets me add equipment and then automatically size the wires based on the load. However, this requires that I compare a load in amps to a chart of wire ampacities, then pick the next size up to size the wire. Is there a way to accomplish something like this in PowerApps?

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, this can be accomplished in PowerApps.  Providing exact details would require knowing more about the data.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    For a simple example, I have a list of equipment in SharePoint. Each item has a number field for amps. I then need to compare it to the wire size, using the first and third columns in this table. If the FLA is 53A, I can see that a Wire Gauge Size #6 would provide me with 65A (>53A), so I might return "#6" as a string.

     

    I did have a second question as well, assuming that works - If I have multiple projects, each with their own SharePoint site and list of equipment, how can I set up the app so it works with all the individual lists independently?

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Sure, at its very basic level, the following formula would return that calculation:

    With({_wires:
     Table({Size: "14", MaxAmps: 20},
     {Size: "12", MaxAmps: 25},
     {Size: "10", MaxAmps: 35},
     {Size: "8", MaxAmps: 50},
     {Size: "6", MaxAmps: 65},
     {Size: "4", MaxAmps: 85},
     {Size: "3", MaxAmps: 100},
     {Size: "2", MaxAmps: 115},
     {Size: "1", MaxAmps: 130},
     {Size: "1/0", MaxAmps: 150},
     {Size: "2/0", MaxAmps: 175},
     {Size: "3/0", MaxAmps: 200},
     {Size: "4/0", MaxAmps: 230},
     {Size: "250", MaxAmps: 255},
     {Size: "300", MaxAmps: 285},
     {Size: "350", MaxAmps: 310},
     {Size: "500", MaxAmps: 380},
     {Size: "600", MaxAmps: 420},
     {Size: "750", MaxAmps: 475},
     {Size: "1000", MaxAmps: 545}
     )},
    
     LookUp(Sort(_wires, MaxAmps, Descending), MaxAmps > 53, Size)
    )

     

    The above formula would return "6".  Of course, I would make the wire table either a list of its own (although it is pretty static in nature) or a global variable in the app (i.e. using the Set function to set a variable to the above table).

     

    As for the individual sites and lists...you would simply need to connect your app to those lists as datasources.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard