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 / Select function, how t...
Power Automate
Answered

Select function, how to add if functions to my items?

(0) ShareShare
ReportReport
Posted on by 21
Hi,
 
I'm still quite new to power automate and expressions in general, so this may be an easy question.
 
I'm trying to use the Select action to make a new array out of my existing array. This I could manage by using the correct item() function, based on the property name that I need. My problem comes when i only want a certain key filled if a condition is met.
 
In this example I'm trying to get some data out of system. For ease of understandig the data is 'ProjectResponsible', 'ProjectType' and 'Price'. My keys are 'Title' and then the differenct project types. Since title corresponds to 'ProjectResponsible' it's easy to get out dynamically. The tricky part is the different project types. My end goal is that I want the 'Price' of the given 'ProjectType' if the 'ProjectType' matches the name in the key of my select function.
 
I know that the if() expression needs a boolean value to determine the results, but is there another way to accomplish what I'm trying to do?
 
I hope it makes sense, and that someone can help make sense of it for me :)
 
Categories:
I have the same question (0)
  • CA1105 Profile Picture
    545 Moderator on at
    Would you pls share your code what you have done so far and what you want to achieve in more details pls? It is hard to understand wihtout seeing this in action or may be throw one example to understand this.
  • MH-05110755-0 Profile Picture
    21 on at
    Hi CA1105,
     
    Of course. What i tried to do was:
     
    if(item()?['ProjectType'], 'Enterprise', item()?['Price'], "-")
     
    This didn't work which, I'm guessing, is because the if expression uses boolean values and I have provided none.
     
    What I specifically want, it for the expression to output the property 'Price' if the project type matches corresponding key i.e if the type is enterprise, it would output the price in under the enterprise key, and leave the other keys blank
     
    Title : Project Responsible
    Enterprise : 'Price'
    Service : N/A
    XX : N/A
    and so on
     
    Hope it clarifies it :)
  • Verified answer
    MH-05110755-0 Profile Picture
    21 on at
    Hi,
     
    I just wanted to say that I found the solution.
     
    if(equals(item()?['ProjectType'],'Enterprise'),item()?['Price'],'')
     
    Compared to my original attempt
     
    if(item()?['ProjectType'], 'Enterprise', item()?['Price'], "-")
     
    The difference is the use of quotes. It's very important to use single quotes when declaring strings. So to anyone new to power apps, and Power Fx in particular, remember this :)

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 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard