cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Create or Update all Checkbox Value in a Bulk

Hello everyone,

 

I have a scenario where I'd like to create or update all the checkbox Item at the same time. However, the challenge over here is with the creation part, what I'm looking for is a way to first look if the checkbox item value is inserted in the database if it is in the database then update the record otherwise create the new record in database.

 

I have read this blog post, it helped me alot. But I'm still looking for a comprehensive solution where it first check if the record is created in database then do update or create it in a bulk.  Would appreciate the help. Thank you

https://powerapps.microsoft.com/ru-ru/blog/bulk-update-using-forall-and-patch/

1 ACCEPTED SOLUTION

Accepted Solutions
shailendra74 Solution Sage
Solution Sage

Re: Create or Update all Checkbox Value in a Bulk

Hi @Anonymous 

 

For existing data which can be populated in Gallery you can try as follows:

 

ForAll(
    Gallery1.AllItems,
    Patch(
        TestUpload, // YOUR SHAREPOINT LIST
        LookUp(
            TestUpload, 
            ID = Value(lblTestID.Text)  // lblTestID.Text is mapped to SP List Item ID
        ),
        {
            myStatus: If(
                chkStatus.Value = true, // chkStatus is the check box check/uncheck
                "Y", // value you want to update back in the list
                "N"
            )
        }
    )
)

For New Item as mentioned in the example (per your query), create a new form and add record. It can be achieved as follows:

 

  1. create a new screen - screen2
  2. onselect of a button of icon from existing gallery screen  write the below code
NewForm(Form1); 
Navigate(Screen2, none)

Set the datasource of Form to the SP List

on submit write below code 

 

SubmitForm(Form1)

onsuccess property of the Form1, you can call Back() method to go back to gallery

 

Thanks.

 

View solution in original post

1 REPLY 1
shailendra74 Solution Sage
Solution Sage

Re: Create or Update all Checkbox Value in a Bulk

Hi @Anonymous 

 

For existing data which can be populated in Gallery you can try as follows:

 

ForAll(
    Gallery1.AllItems,
    Patch(
        TestUpload, // YOUR SHAREPOINT LIST
        LookUp(
            TestUpload, 
            ID = Value(lblTestID.Text)  // lblTestID.Text is mapped to SP List Item ID
        ),
        {
            myStatus: If(
                chkStatus.Value = true, // chkStatus is the check box check/uncheck
                "Y", // value you want to update back in the list
                "N"
            )
        }
    )
)

For New Item as mentioned in the example (per your query), create a new form and add record. It can be achieved as follows:

 

  1. create a new screen - screen2
  2. onselect of a button of icon from existing gallery screen  write the below code
NewForm(Form1); 
Navigate(Screen2, none)

Set the datasource of Form to the SP List

on submit write below code 

 

SubmitForm(Form1)

onsuccess property of the Form1, you can call Back() method to go back to gallery

 

Thanks.

 

View solution in original post

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,821)