Hi
I have read some post in here regarding patch a checkbox to SharePoint, but I can't make it work.
I have a SharePoint list called SAP_import, with a collumn named "Checkbox" (YES/NO field)
I have a galley with a checkbox for each item/row.
OnUncheck : Patch(SAP_Import;ThisItem.CheckBox,{Checkbox:"Yes"})
OnUncheck: Patch(SAP_Import;ThisItem.CheckBox; {Checkbox: No})
Default: If(ThisItem.CheckBox="Yes";true;false)
It says boolean not valid, should be a value
Can anyone see what is wrong ?
Solved! Go to Solution.
Hi @Thansson ,
Do you want to use a checkbox to update a yes/no field of sharepoint list?
If so, you should compare this field with true or false, not "yes" or "no".
"Yes" or "No" is text string, not boolen value.
Try to set this:
the checkbox's OnCheck:
Patch(SAP_Import;ThisItem,{Checkbox:true})
//the second parameter should be the item that you want to update
the checkbox's OnUncheck:
Patch(SAP_Import;ThisItem; {Checkbox: false})
checkbox's Default:
ThisItem.Checkbox
Best regards,
Which line are you getting the error on?
A notes - shouldn't the first item be 'OnCheck'?
Also, I think you need to replace the Yes/No here with true/false. Plus remove any quotes.
OnUncheck : Patch(SAP_Import;ThisItem.CheckBox,{Checkbox:"Yes"})
OnUncheck: Patch(SAP_Import;ThisItem.CheckBox; {Checkbox: No})
Hi Tks.
Yes I spelled wrong.
I dont get any error, it dosn't work at all, but if I move the cursor to the line, it tells wrong type data, but I cant change the YES/No in SharePoint, as far as I know
Hi @Thansson ,
Do you want to use a checkbox to update a yes/no field of sharepoint list?
If so, you should compare this field with true or false, not "yes" or "no".
"Yes" or "No" is text string, not boolen value.
Try to set this:
the checkbox's OnCheck:
Patch(SAP_Import;ThisItem,{Checkbox:true})
//the second parameter should be the item that you want to update
the checkbox's OnUncheck:
Patch(SAP_Import;ThisItem; {Checkbox: false})
checkbox's Default:
ThisItem.Checkbox
Best regards,
Thank You
Working😁
Hi Again
It is working, but the default need to be changed around.
The default when open app it is "Checked".
How will you make default? I'am geting error no matter what I try.
Hi @Thansson ,
Do you mean that:
you want that checkbox display as checked by default?
If so, you just need to set the checkbox 's Default to : true.
If you want this checkbox display that field value by default, then you should set the check box's Default to :
ThisItem.yesornofieldname
Best regards,
Hi v-yutliu-msft
I want checkbox to be unchecked as default.
If I set Checkboks to default = False
the checkbox will no longer patch, nothing happends in the app?
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
258 | |
247 | |
82 | |
36 | |
30 |
User | Count |
---|---|
299 | |
267 | |
117 | |
66 | |
45 |