I am a little lost with this one. I have a SharePoint list data source that contains Countries along with their associated region and country code.
The user selects the region from a dropdown and then selects the country from a 2nd dropdown that has been filtered by the region. This part is working fine.
The next step is to have the OnChange of the Country dropdown set a Variable containing the country code for the selected country so it can be populated into a label.
I am struggling with the proper syntax to collect the country code for the selected country. This was SO much easier in InfoPath 🙃
Any help would be appreciated.
Solved! Go to Solution.
oh.. that is my bad if that is the case here is the code block for that.
UpdateContext({varCountryCode:Lookup(Sharepointlist,(country=dropdowncountry.selected.value),CountryCode)})
Now you set this variable back to the label.
I hope this resolved your issue if you see any challenge let me know I am always happy to help.
Regards,
Krishna
If this post helps, then please consider Accept it as the solution and give thumbs-up to help the other members find it more.
hi @JR-BejeweledOne,
It is much easier in PowerApp also, here is the code for that.
Step1: for dropdown Onselect event: updatecontext({varSelectCountry:dropdowncountry.selected.value})
Step 2: set this variable for label Text property varSelectCountry
Boom you can see the selected country.
I hope this resolved your issue if you see any challenge let me know I am always happy to help.
Regards,
Krishna
If this post helps, then please consider Accept it as the solution and give thumbs-up to help the other members find it more.
Show the items on the dropdown will help.
But try:
Set(Myselected,Dropdown1.Selected.Value )
Or
Set(Myselected,Dropdown1.Selected.Result)
Or
Set(Myselected,Dropdown1.Selected.ColumName)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Sorry that's not what I am trying to do. If you look at the list there are 3 columns of data. Region, Country and CountryCode.
I have the Region and then the Country in the dropdowns. I need to set the Variable to the country code for the selected country.
Thank you
This is not what I am trying to do. I already have the correct values for the dropdowns working fine. My list has 3 columns as you can see, Region, Country and Country code.
The user selects the Region from the dropdown and then selects a country from the Country dropdown. The country dropdown is filtered by the Region that is selected in the Region dropdown. Once the Country is selected, I need to populate a variable with the Country Code.
What I don't know how to do is property format the command to filter the country code from the selected country in this particular scenario.
oh.. that is my bad if that is the case here is the code block for that.
UpdateContext({varCountryCode:Lookup(Sharepointlist,(country=dropdowncountry.selected.value),CountryCode)})
Now you set this variable back to the label.
I hope this resolved your issue if you see any challenge let me know I am always happy to help.
Regards,
Krishna
If this post helps, then please consider Accept it as the solution and give thumbs-up to help the other members find it more.
Thank you. That worked. I haven't used the Update Context function yet, so this is very helpful.
User | Count |
---|---|
246 | |
103 | |
82 | |
49 | |
42 |