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!