cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ramole
Memorable Member
Memorable Member

Checkboxes check/uncheck Update patch

Hello everyone, I am trying to make a gallery and insert checkbox also one outside checkbox so the thing I wanted to do is when I select the checkbox single line data I can have a button to patch that selected record or if I select outside checkbox to select all record and when press the button to patch only updated changes, my data is on SharePoint Thank you

Thank you
If this post helps, then please consider Accept it as the solution to help the others and consider giving it a "Thumbs Up."
1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User III
Super User III

Reset the Checkbox at the end of your code: Reset(OutsideCheckbox)

ForAll(
    RenameColumns(
        BrowseGallery1.AllItems,
        "ID",
        "NewID"
    ),
    If(
        Checkbox1.Value,
        Patch(
            MyFirstList,
            LookUp(
                MyFirstList,
                ID = NewID
            ),
            {
                Title: TextInput2.Text,
                FirstName: TextInput1.Text
            }
        )
    )
);
Reset(OutsideCheckbox)

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

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.

View solution in original post

5 REPLIES 5
eka24
Super User III
Super User III

@Ramole  consider this :

Patching on single select of the checkbox, put this code on the OnCheck of the checkbox inside the Gallery. 

That is if the checkbox outside the Gallery is not checked.

 

If(
    !CheckboxOutside.Value,
    Patch(
        MyFirstList,
        LookUp(
            MyFirstList,
            ID = ThisItem.ID
        ),
        {
            Title: TextInput2.Text,
            FirstName: TextInput1.Text
        }
    )
)

 

If the checkbox outside is checked, then all the checkboxes inside the Gallery would apply therefore this second formula would be use instead:

 

When you want to patch multiple items after multiple checkboxes have been ticked, Onselect of the Button:

ForAll(
    RenameColumns(
        BrowseGallery1.AllItems,
        "ID",
        "NewID"
    ),
    If(
        Checkbox1.Value,
        Patch(
            MyFirstList,
            LookUp(
                MyFirstList,
                ID = NewID
            ),
            {
                Title: TextInput2.Text,
                FirstName: TextInput1.Text
            }
        )
    )
)


Am assuming you already have a way of checking all checkboxes inside the Gallery
------------

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.

Ramole
Memorable Member
Memorable Member

Hi @eka24 

How can I make when the outside checkbox selected to control inside checkbox so i have ability to uncheck and check from outside checkbox please let me know how 

 

Thanks 

 

 

thanks 

Thank you
If this post helps, then please consider Accept it as the solution to help the others and consider giving it a "Thumbs Up."
eka24
Super User III
Super User III

In the Default of the Checkbox inside the Gallery, put;

OutsideCheckbox.Value

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

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.

Ramole
Memorable Member
Memorable Member

Hi @eka24 

 

How about when I Patch to deselect all check box after the patch please 

 

Thanks 

Thank you
If this post helps, then please consider Accept it as the solution to help the others and consider giving it a "Thumbs Up."
eka24
Super User III
Super User III

Reset the Checkbox at the end of your code: Reset(OutsideCheckbox)

ForAll(
    RenameColumns(
        BrowseGallery1.AllItems,
        "ID",
        "NewID"
    ),
    If(
        Checkbox1.Value,
        Patch(
            MyFirstList,
            LookUp(
                MyFirstList,
                ID = NewID
            ),
            {
                Title: TextInput2.Text,
                FirstName: TextInput1.Text
            }
        )
    )
);
Reset(OutsideCheckbox)

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

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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,221)