cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnthonyJrJr
New Member

Canvas app - Checkbox change text status based on selection (field is not boolean)

Hi guys,

I need a help with canvas app checkbox control.

This is the situation:

 

Default:

If(ThisItem.Status.Value = "Open", true, false)

So based on the status from Sharepoint: "Open" or "Closed" I'm checking or un-checking the box.

 

What I don't know how to do is - I want to make onCheck control -> to change the status and change status in SharePoint list.

So if checkbox was checked based on the Status.Value, which means, it's stored as "Open" in SP - if I click on the checkbox, I want to change entry in SharePoint to "Closed"

 

 Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Patch('Employee Tasks',LookUp('Employee Tasks', ID = ThisItem.ID,
{
Status: ThisItem.Status.Value
})

 

Something like that

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

View solution in original post

5 REPLIES 5
Nogueira1306
Community Champion
Community Champion

Hey!

You need to use a Patch to update

Patch(

DATASOURCE,

LOOKUP,

{

THISITEM

})

 

Or, you can Submit the form, if it is a form

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

AnthonyJrJr
New Member

@Nogueira1306 

Thank you for you help, but I don't understand the syntax 😞
I need to patch every item individually on change 

 

Source name is 'Employee Tasks'

Status.Value ("Status" is the name of the field in SharePoint) list have only 2 statuses for each task -> "Open" , "Closed" and it's text field type (cannot change to boolean) so I have to work with the text type

 

 

Patch('Employee Tasks',ThisItem.Status.Value, ....

 

 

And now I don't understand what I have to type down to complete this "Patch"

Could you do it for me?
Thanks

 

Patch('Employee Tasks',LookUp('Employee Tasks', ID = ThisItem.ID,
{
Status: ThisItem.Status.Value
})

 

Something like that

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

View solution in original post

@Nogueira1306 
I'm getting an error

This would be OnUncheck

Patch('Employee Tasks', LookUp('Employee Tasks', ID = ThisItem.ID),
{
Status: "Closed"
})

 

My mistake, type of the field "Status" is Choice 🙂

So what do I have to do now to change the status.

Sorry sorry

 

This would be the last step

 

Untitled.png

Solved

 

Patch('Employee Tasks', LookUp('Employee Tasks', ID = ThisItem.ID),
{
Status: {Value: "Closed"}
})

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,242)