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

Update Choice field with a button OnSelect

In my EditForm, I have a Choice field Status with two options: Open/Closed. I want to hide this choice field, add a Close button that will change the value of the choice filed to Closed (and then Submits the Form).

 

I'm struggling to get the button working.

 

Any help will be much appreciated!

 

Nevermind, I found it: https://powerusers.microsoft.com/t5/General-Discussion/Update-SharePoint-list-choice-column-dropdown...

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Update Choice field with a button OnSelect

Hi @GrischkePro ,

Could you please share a bit more about the Choice field that you mentioned? Is it a Choice type column in a SP list?

Do you want to change the Choice field value within the Edit form to Closed when you click the "Close" button?

 

I have made a test on my side, take a try with the following workaround:

Set the OnVisible property of the Edit screen to following:

Set(ChoiceVar, Blank())

Set the OnSelect property of the "Button" to following:

Set(ChoiceVar, {Value: "Closed"})

Set the DefaultSelectedItems property of the ComboBox within the Choice field Data card to following:

If(
   !IsBlank(ChoiceVar),
   ChoiceVar,
   Parent.Default
)

Please take a try with above solution, check if the issue is solved.

 

If the issue is solved, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Highlighted
Community Support Team
Community Support Team

Re: Update Choice field with a button OnSelect

Hi @GrischkePro ,

Could you please share a bit more about the Choice field that you mentioned? Is it a Choice type column in a SP list?

Do you want to change the Choice field value within the Edit form to Closed when you click the "Close" button?

 

I have made a test on my side, take a try with the following workaround:

Set the OnVisible property of the Edit screen to following:

Set(ChoiceVar, Blank())

Set the OnSelect property of the "Button" to following:

Set(ChoiceVar, {Value: "Closed"})

Set the DefaultSelectedItems property of the ComboBox within the Choice field Data card to following:

If(
   !IsBlank(ChoiceVar),
   ChoiceVar,
   Parent.Default
)

Please take a try with above solution, check if the issue is solved.

 

If the issue is solved, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GrischkePro
Level: Powered On

Re: Update Choice field with a button OnSelect

Thanks @v-xida-msft,

 

This works great too!

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: 308 members 5,304 guests
Please welcome our newest community members: