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

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard