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 / Display Form Data from...
Power Apps
Answered

Display Form Data from 1 of 2 fields (whichever has data)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey all!

 

I have a user option that is a Yes or No.  Based on that selection, 1 of two different items populates.  Either a dropdown where they can select to reactivate an old title, or a text field where they can type out the name of a new title.

 

The dropdown menu name is - Dropdown1

The datacard for typing would be - DataCardValue9

 

I want to populate a 3rd field based on the data in the previous fields. 

I need assistance as I am terribad with formulas, I know there would be three ways to achieve this. 

1) Either use the True or False from the selection field and based on that select the data to populate.  Ex. If False - use DataCardValue9.  If true Dropdown1.SelectedText.Value

 

2) Straight up combine both columns 'Dropdown1.SelectedText.Value' + 'Datacardvalue9?' (not sure how to combine).  With the idea that as long as there was no spaces in between only the non-blank value would appear.

3) Check if blank and display which one has data.

 

Any option that works I will utilize.  Thank you in advance!

example_title2.PNG
example_title3.PNG
example_title.PNG
Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    I'd do a variation of Option #1.

     

    • Create the toggle button (let's call it toggle1)
    • The user would choose yes/no from toggle1
    • Now create a text input field (lets call it text1)
    • Set the Visible property to If(toggle1.value=true,true,false)
    • Then create a dropdown field in the same position (lets call it drpdown1)
    • Set the Visible property to If(toggle1.value=false,true,false)
    • Ensure all toggle1, text1 and drpdown1 are all on the same DataCard
    • Change the DataCard property called Update to If(toggle1.value=true, text1, drpdown1.SelectedText.Value)

     

    That's the general strategy right there!

     

    ---

    Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

     

     

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

    One way to do it would be to use the UpdateContext() function to create a local variable.  The variable would depend on the state of your two inputs.  You would then assign the variable to the Text property of the third control.  In your case, there are three possibilities. 

    The dropdown value is default and there is nothing in the textbox.  

    Dropdown1.Selected.Value = "default" && !IsBlank(Textinput1.Text)

     

    the Dropdown value is <> "default" and the textbox is blank

    Dropdown1.Selected.Value <> "default" && IsBlank(Textinput1.Text)

    The dropdown value is <> "default" and there is data in the textbox.

    Dropdown1.Selected.Value <> "default" && !IsBlank(Textinput1.Text)

    Putting there together in the UpdateContext() function would look like this and could be assigned to a button on the screen.

    UpdateContext({option: If(Dropdown1.Selected.Value = "default" && !IsBlank(Textinput1.Text),"",
    Dropdown1.Selected.Value <> "default" && IsBlank(Textinput1.Text),"Blah Blah",
    Dropdown1.Selected.Value <> "default" && !IsBlank(Textinput1.Text), "Blah Blah Blah")})

    Powerapps interprets If() statements for a condition that results in a true value and stops when it finds one.  You would set the Text property of the third contol to option.  In the OnVisible property of the form, you would put UpdateContext({option: ""}) so that the third control was blank to start but on using the first two controls and then pressing the button, the third control would populate with the appropriate value. 

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Testing after lunch, thumbs up now for the time you put into helping me-

     

    Thank you so much!!!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard