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

Patch record if checkbox is selected

Hi everyone,

I am trying to create a Patch to save record to Table1 only if Checkbox2 is selected.

My created Patch is not working:

 

Patch('Table1', Defaults('Table1'),

    {

                If(Checkbox2.value=true,

                                Title: User().FullName,

                                TimeStamp:Now(),

                                Comment: Comment.Text

});

    Navigate(SuccessScreen)

 

Any help is much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Miki595
New Member

Solution found:

If(Checkbox2.Value=true,

Patch(

    'Table1',

    Defaults('Table1'),

    {

Title: User().FullName,

        TimeStamp:Now(),

        Comment: Comment.Text

}),"")

View solution in original post

5 REPLIES 5
eka24
Super User
Super User

If you are working with a checkbox and a Gallery to patch, watch this tutorial;

https://youtu.be/gKWf_XQyIH0

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Miki595
New Member

Solution found:

If(Checkbox2.Value=true,

Patch(

    'Table1',

    Defaults('Table1'),

    {

Title: User().FullName,

        TimeStamp:Now(),

        Comment: Comment.Text

}),"")

View solution in original post

ArchitectMadhan
Post Patron
Post Patron

Hi @Miki595 

You might need to change your formula little bit. Patch statement should be within the If statement. You can write this formula in button -> OnSelect() property.

If(Checkbox2.value=true,

Patch('Table1', Defaults('Table1'),{Title: User().FullName,TimeStamp:Now(),Comment: Comment.Text });   Navigate(SuccessScreen), Notify("Not Patched"))

 

If you find my solution helpful for resolving the issue, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Miki595 ,

Since you have solved your issue and found the correct formula, you can mark your reply as a solution. This will benefit other community members who stuck with the same question.

Best regards,

Allen

Hi @Miki595 ,

 

Good to see that my solution worked for you, thanks! 

Re: Patch record if checkbox is selected - Power Platform Community (microsoft.com)

If you find my solution helpful for resolving the issue, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

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
Users online (1,305)