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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,984)