cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Pass global variable value to select drop down option (single select)

Hi,

I am new to Power Apps. I am building a power app customising a SharePoint form. One of the columns is a drop-down, called 'Category'.

I am setting the power app in such a way that all these drop down options are in the form of buttons in the layout. Based on which button the user clicks, I want the column 'Category' to get updated with the button value selected.

For eg. Buttons are A, B, C, D, E, F, G..these buttons also represent the drop down options in Category field.

If I select B, I want the drop down in the Category field to get updated as 'B' and then send this value back to SharePoint on submission of the form. 
I have set a global variable as 'varCategorySelection' which has the value of the respective button selected - so in this case 'B'.

I am trying to set the 'Default' property of the dropdown equal to varCategorySelection, but it is not working. 

What can I do to resolve this ?

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

@Sumit_Mathew 

 

rsaikrishna_0-1602549702571.png

 

On Select property of each button:  Set(varCategorySelection, "A")    

 

Replace "A" based on the button choice such as "B" or "C" and so on.

 

For drop down's default value:

LookUp(Choices([@<SharePoint List Name>].<Choice Field Name>),Value=varCategorySelection).Value

 

Please same formula in the Update property as well.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

 

 

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

@Sumit_Mathew 

 

rsaikrishna_0-1602549702571.png

 

On Select property of each button:  Set(varCategorySelection, "A")    

 

Replace "A" based on the button choice such as "B" or "C" and so on.

 

For drop down's default value:

LookUp(Choices([@<SharePoint List Name>].<Choice Field Name>),Value=varCategorySelection).Value

 

Please same formula in the Update property as well.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

 

 

View solution in original post

@rsaikrishna 
Thanks for your reply. I used the formula on the datacard default and update and its working perfectly fine. Thank you for your time today.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,466)