cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
imaliasad
Level: Powered On

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
Level 10

Re: Create or Update all Checkbox Value in a Bulk

Hi @imaliasad 

 

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
Level 10

Re: Create or Update all Checkbox Value in a Bulk

Hi @imaliasad 

 

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,389)