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.

 

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.

 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 557 members 5,871 guests
Please welcome our newest community members: