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 / Setting value of a dro...
Power Apps
Answered

Setting value of a dropdown based on global variable

(0) ShareShare
ReportReport
Posted on by 135

Working on a canvas app with a SPList.  The SPList has columns for data, one including a Location Choice column.  The choices are Chicago or Atlanta (may include more sites later on).

 

Screen 1 has 2 buttons to select the location.

Button1  OnSelect property:  Set(varSite, "Chicago")

Button2 OnSelect property:  Set(varSite, "Atlanta")

 

Screen 2 has the form, including the datacard for the site.  For the dropdown's Default property I put in the following:
LookUp(Choices(SPList.Location),Value=varSite) (i've also tried Text = varSite which doesn't work)

For the DataCard's Update property, I put in the same thing.

 

This does not save the information.  If I add a .Value at the end of the Default and Update properties, I get this error:

Smilee279_1-1646156891034.png

 

I was using this solution to help--which looked like it would, but it is not saving the data.  I've tried patching the variable as well, which isn't working.  I'm out of ideas on how to have it default to the global variable's data as the selection for the drop-down.  Help!

Categories:
I have the same question (0)
  • shoog Profile Picture
    2,164 on at

    Do you want to be able to modify the value using the dorpdown or is that just informational?

    Right now you are updating with the same value as the default.

     

    If you want to update with the selected value, you should modify the update property to

    DataCardValue1.Selected

     * replace the 1 with the right value of the datacardvalue under the datacard you are trying to update.

  • Smilee279 Profile Picture
    135 on at

    @shoog  that may 100% work...but the data from the global variable isn't passing into the default for the drop-down.  I'm sure once that's populating correctly, the update property should work.

  • Verified answer
    shoog Profile Picture
    2,164 on at

    What is the Items property of the dropdown?

    It should be something like Choices([@SPlist].Location)

     

    Did you set the Default at the datacard level or explicitly in the dropdown? The common way is to set it at the datacard and keep the dropdown DefaultSelectedItems set to Parent.Default

  • Verified answer
    Smilee279 Profile Picture
    135 on at

    I moved the lookup LookUp(Choices(SPList.Location),Value=varSite) to the Default at the datacard and set the DefaultSelectedItems to Parent.Default.  

     

    Thank you!!

  • CVR Profile Picture
    3 on at

    In my case, I have needed to make a little adjust in the expression to Default property as follow: LookUp(Choices(SPList.Location),Value in varSite). After that, it worked perfectly.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard