cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Change a Text Input value after Save on Check/Uncheck of a checkbox

I have a customized SharePoint Form where if a checkbox is checked by an approver  a button is enabled to start a workflow by another team.  On unchecking it is disabled. The value of the checkbox is saved in a single line of text in SharePoint list. On checking the text field in SharePoint is marked as checked.

 

I have put OnCheck of the checkbox property to assign a variable varCheck as "Checked'" and OnUncheck as Blank().  The Approver can uncheck and recheck the checkbox even after it has been  saved as "Checked" in SharePoint list in column AllowWF, till the button is clicked to submit to workflow,

 

What default should be put in the Text Input box so that Checkbox changes are reflected in the Text Input box through out. After the workflow the checkbox will remain checked.

 

I try to put OnEdit of SharePoint Integration by Set(varCheck,SharePointIntegration.Selected.AllowWF) and putting the default for the Text Input to varCheck if the status is before flow and Parent.Default after the flow, but the desired results are not coming. The variable on ititial seeting remains blank even if the field is "Checked". Main point is that it should be able resave as Blank or "Checked" depending on the value of checkbox.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @jaimat ,

Maybe you should use "SharePointIntegration.Selected.AllowWF" to set the checkbox's deafult and textinput's default.

Try to set like this:

1)Checkbox's Default:

If(SharePointIntegration.Selected.AllowWF="Checked",true,false)

2)checkbox's OnCheck:

Set(var,true);Set(varCheck,"Checked");Reset(textinputname)

3)checkbox's OnUncheck:

Set(var,true);Set(varCheck,Blank());Reset(textinputname)

 4)set the textinput's Default:

If(var,varCheck,
    SharePointIntegration.Selected.AllowWF
)

 //Then at the beginning, the checkbox and the textinput display based on the field value.

If you make any change on that checkbox, the textinput's default will display based on the variable.

 

 

Best regards,

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.

View solution in original post

6 REPLIES 6
Community Support
Community Support

Hi @jaimat ,

Do you mean that:

1)you use a checkbox's OnUncheck and OnCheck to set a variable?

2)you set a textinput's Default to that variable?

3)your textinput could not reflect the checkbox's changing ?

If so, I suggest you add an action about resetting the textinput. Then even if you change the value of the textinput, it will return to the variable value.

Try to set like this:
1)checkbox's OnCheck:

Set(varCheck,"Checked");Reset(textinputname)

2)checkbox's OnUncheck:

Set(varCheck,Blank());Reset(textinputname)

 3)set the textinput's Default:

varCheck

 

 

Best regards,

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.

Thank you very much for the response. The solution is alright till it is Saved. But when the user saves the form the SharePoint list column is updated with "Checked" value. But when the form is opened again (may be after  a day or two) the variable is blank due to new session and the text input shows blank in place "Checked" and consequently the checkbox remains unchecked. The user should be able to Change the value till it is placed in the workflow.

 

I tried setting varCheck  at SharePointIntegration OnEdit event like Set(varCheck,SharePointIntegration.Selected.AllowWF) but the variable remains blank and consequently the text input  and checkbox value remains empty when the forms loads again.  Why should the variable remain blank at this stage when the column has got value "Checked". Putting Set(varCheck,SharePointIntegration.Selected.AllowWF)  OnVisible also keep the variable blank on reload unless of course, I recheck the checkbox (in both the above cases). AllowWF is the SharePointlist text column name to save the value.

 

Looking for a solution on specifically on reload of the form!!

Hi @jaimat ,

Maybe you should use "SharePointIntegration.Selected.AllowWF" to set the checkbox's deafult and textinput's default.

Try to set like this:

1)Checkbox's Default:

If(SharePointIntegration.Selected.AllowWF="Checked",true,false)

2)checkbox's OnCheck:

Set(var,true);Set(varCheck,"Checked");Reset(textinputname)

3)checkbox's OnUncheck:

Set(var,true);Set(varCheck,Blank());Reset(textinputname)

 4)set the textinput's Default:

If(var,varCheck,
    SharePointIntegration.Selected.AllowWF
)

 //Then at the beginning, the checkbox and the textinput display based on the field value.

If you make any change on that checkbox, the textinput's default will display based on the variable.

 

 

Best regards,

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.

View solution in original post

Wonderful!! This is a perfect solution. Thanks a lot for this quick resolution, that was  urgently require to complete an app. Just one question. When I unchecked the checkbox, the text input was correctly reflecting Blank, but in was not saving to the SharePoint list column which remained 'Yes' after saving. I had to change  it to 'No' in place of Blank() to save it to the list. 

 

Can it be written to the list as Blank to replace "Yes" on saving the form again.

 

Thanks again for the solution.

Frequent Visitor

Just to clarify the above I changed 'Checked' to 'Yes' to complement  with 'No', as the Blank was somehow not saving. 

 

Thanks again.

 

Frequent Visitor

I just realize the default value for text input box : If(var,varCheck, SharePointIntegration.Selected.AllowWF ) does not work on new form. Since there is no record created in the list in new form SharePointIntegration.Selected.AllowWF takes the text input value of the e1st record and accordingly the checkbox opens checked or unchecked. 

 

We want it to always open unchecked. What changes to be made for that

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 (12,325)