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 / IF function with two a...
Power Apps
Answered

IF function with two alternatives

(0) ShareShare
ReportReport
Posted on by 353

Hi Community,

 

I need to implement that the value saved in a sharepoint list is depending on the value selected from a dropdown list.
I have this formula, but only when selecting the value "A" the data is recorded (input "Mom_1"), but when selecting the value "B" or "C" all blank values are recorded. What should I correct?.


"Exists Vol": Sharepoint list column name
"Con_1": is the name of the drop-down list, which contains the values "A", "B", "C", and "D".
Mom_1: is the text entry that provides the value to be recorded when "A", "B" or "C" is selected.
Mom_2: is the text entry that provides the value to be recorded when "D" is selected.

 

OneSelect formula=   '¿Exist. Vol?': If('Con_1'.Selected.Value = "A" || "B" || "C" ;'Mom_1'.Selected.Value;'Mom_2'.Selected.Value)

 

Regards,

 

Francisco

 

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @Francisco77 ,

     

    Do you want this?

    1/Select A, 'Mom_1'.Selected.Value.

    2/Select B or C, blank value.

    3/Select D, 'Mom_2'.Selected.Value

     

    Please try this.

    '¿Exist. Vol?':
    Switch('Con_1'.Selected.Value;
    "A";'Mom_1'.Selected.Value;
    "B";"";
    "C";"";
    "D";'Mom_2'.Selected.Value)

     

     

    Best regards,

    Rimmon

  • Verified answer
    realwillwright Profile Picture
    772 Moderator on at

    Hi @Francisco77 

     

    You can use a switch to select which value you want

     

    Switch(
     Con_1'.Selected.Value, 
     "A",
     'Mom_1'.Selected.Value,
     "B",
     'Mom_1'.Selected.Value,
     "C",
     'Mom_1'.Selected.Value,
     "D",
     'Mom_2'.Selected.Value
    )

     

    or you could keep it similar to what you had but you need to do an or for all of the values or use an in 

     

    '¿Exist. Vol?': If('Con_1'.Selected.Value in "ABC";'Mom_1'.Selected.Value;'Mom_2'.Selected.Value)
    
    
    '¿Exist. Vol?': If('Con_1'.Selected.Value = "A" || 'Con_1'.Selected.Value = "B" || 'Con_1'.Selected.Value = "C" ;'Mom_1'.Selected.Value;'Mom_2'.Selected.Value)

    Hopefully one of those options will solve your issue


    -------------------------------------------------------------------

    If my reply helped you, please give a 👍
    If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it.

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard