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 Apps / Override default of dr...
Power Apps
Unanswered

Override default of dropdown

(0) ShareShare
ReportReport
Posted on by 920 Super User 2024 Season 1

Hi,

 

I have dropdown where property default is set to a certain value.

 

Default property - If ( DataCardvalue1.Selected.Value = "Canada", "Justin Trudeau", If(DataCardValue1.Selected.Value = "USA", "Joe Biden))

 

Items property = ["Justin Trudeau","Joe Biden"]

 

So I want it to default based on DataCardValue1. But I want to be able to override the default.

 

So when I override and switch the dropdown to Joe Biden even though datacardvalue1 = Canada, it does save in the backend sharepoint successfully.

 

But it doesnt show, Joe Biden in the item. It will always default to Justin Trudeau.

 

IS there anyway I can get it to show the accurate value?

 

 

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    try this

     

    OnVisible of Screen or DataCard: Initialize a variable:

    UpdateContext({UserSelection: ""})

     

    OnChange of Dropdown: Update the variable with the user's selection:

    UpdateContext({UserSelection: Dropdown.Selected.Value})

     

    default dropdown

    If(IsBlank(UserSelection), 
     If(DataCardValue1.Selected.Value = "Canada", "Justin Trudeau", 
     If(DataCardValue1.Selected.Value = "USA", "Joe Biden")),
     UserSelection)

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @mmbr1606 what is OnVisible of Screen or DataCard? I see Visible on my datacard but cant put anything other then true or false!

  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    each screen has an onvisible property

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    thanks, i think its close, I cant seem to get it to work! its still showing my First Submit of that field. 

     

    It looks like UserSelection keeps going back to blank when i go back to the screen!

  • scalca Profile Picture
    on at

    getting selected value of form works only with Form Mode View or New


  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @scalca 

    Darn, I do not use View Mode. 

    I am using Edit Mode to edit an existing submitted field!

  • scalca Profile Picture
    on at

    can you check Item property of your form ? 
    it works on edit mode if the form is connected to an item, 

    scalca_0-1702313077490.png

     

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    @scalca  yes it is - 

    I have - LookUp('Data Source',ID=gblRecordID)

     

     

     

  • SpongYe Profile Picture
    5,616 Super User 2025 Season 2 on at

    Hi @wonka1234 

     

    I would suggest to use a variable for what you want to achieve. 

    In the DataCardvalue1.Selected.Value set the OnChange property to:

    UpdateContext({varCountry: Self.SelectedText.Value})

    SpongYe_0-1702323253859.png

     

    Then you can also use this variable in the screen to change the default value if it exists in the dropdown. 

    In the Default property of the other dropdown you change the code to:

    If(
     varCountry = "Canada", 
     "Justin Trudeau", 
     varCountry = "USA", 
     "Joe Biden"
    )

    You don't need nested if statements you can directly add a logic behind one logic. 

     

    SpongYe_1-1702323341714.png

     

    Then on a button you can update the variable to override the existsing value:

    UpdateContext({varCountry: "USA"})

    SpongYe_2-1702323466519.png

     

    Hope this help you.

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

     

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard