Bulk creating items in PowerApps using For All and Patch

In one of my projects, I got a requirement to get the data from Multiple tables in SQL server and update it to SharePoint list. I have using Join function to combine three tables and saved it to a collection as below.

ClearCollect(EmployeeDetails,

    AddColumns(

        Employees,

        "Subjects",

        LookUp(Subjects, EmployeeId = Orders[@EmployeeId])))

After collecting data, we can loop all the data in the collection and update it to SharePoint list using the patch function as below.

ForAll(EmployeeDetails, Patch(

                MarksDetails,

                Defaults(MarksDetails),

                {Marks1: Marks1,

                Marks2: Marks2,

                Marks3: Marks3,

                Marks4: Marks4,

                Created: Now()}))

It will save all the data from Employee Details collection to Marks Details list in SharePoint.


Comments

Popular posts from this blog

Linksys Wireless Connection Failure

The security validation for this page is invalid. Click Back in your Web

Power Apps toPower Automate Error - The input body for trigger 'manual' of type 'Request' did not match its schema definition , the input String does not validate against the date