cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (49,219)