Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Override default of dropdown

(0) ShareShare
ReportReport
Posted on by 909 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?

 

 

 

  • SpongYe Profile Picture
    5,580 Super User 2025 Season 1 on at
    Re: Override default of dropdown

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

     

     

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Override default of dropdown

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    @scalca  yes it is - 

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

     

     

     

  • scalca Profile Picture
    on at
    Re: Override default of dropdown

    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
    909 Super User 2024 Season 1 on at
    Re: Override default of dropdown

    @scalca 

    Darn, I do not use View Mode. 

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

  • scalca Profile Picture
    on at
    Re: Override default of dropdown

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


  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Override default of dropdown

    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!

  • mmbr1606 Profile Picture
    11,991 Super User 2025 Season 1 on at
    Re: Override default of dropdown

    each screen has an onvisible property

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Override default of dropdown

    @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
    11,991 Super User 2025 Season 1 on at
    Re: Override default of dropdown

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard