cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EMohaisen
Helper I
Helper I

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
yashag2255
Dual Super User II
Dual Super User II

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!

Hi @yashag2255 

 

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

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.

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!

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (74,873)