cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EMohaisen
Level: Powered On

Change a choice field value when clicking on a button

Hi All,

 

I have a drop down field (type=Choice), i want to have abutton so when i click on it, it will chane the value of this choice field, example from "Pending" to "In Porgress", i tried create a variable and set it as a default to the Choice field but it seems this works only with fields type=Text. 

 

please find attached screenshot for more info, any ideas please?

 

thanks!

 

 

5 REPLIES 5
Super User
Super User

Re: Change a choice field value when clicking on a button

Hi @EMohaisen 

 

You can modify the "Update" property of your DataCard as:
If(!IsBlank(Var_HMT),{Value:Var_HMT},DataCardValue27.Selected)
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
EMohaisen
Level: Powered On

Re: Change a choice field value when clicking on a button

Hi @yashag2255 

 

Thanks for the reply, but actually it's giving me an error (attached)

Community Support Team
Community Support Team

Re: Change a choice field value when clicking on a button

Hi @EMohaisen ,

Could you show me how do you set Var_HMT?
Is this choice field single choice?

I've made a similar test but not met the error that you showed.

Here's my test: (my choice field is single choice)

1)Set the button's OnSelect:

Set(Var_HMT,"In Porgress")

2)Set the drop down's Items:
Choices(listname.columnname)

Set the drop down's Default to empty

Set the data crad's Update:

If(!IsBlank(Var_HMT),{Value:Var_HMT},DataCardValue27.Selected)

 

Then if I cilck the button, the choice's field will update with the "In Porgress" value.

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Change a choice field value when clicking on a button

Hi @EMohaisen 

 

Based on the previous screenshot that you have shared, you are setting up this variable on the Submit button itself. Please make sure you are using correct attributes/controls name in the formula. Are you getting this error on the Update Property? Can you share a screenshot of the part where exactly you are getting this error? Please share the specifics there might be some type mismatch around this expression because based on a similar test that I carried out on my end, this updates the choice field successfully.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Highlighted
EMohaisen
Level: Powered On

Re: Change a choice field value when clicking on a button

Thank you all, I will try and get back to you!

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 358 members 4,923 guests
Please welcome our newest community members: