Power Apps ForAll:Copy & Insert Records from One Datasource To Another Datasource

Requirement

Copying & Inserting Records from One Datasource To Another Datasource in Microsoft Power Apps using ForALL & PATCH

Scenario

We have 2 datasources or tables. First datasource “List” is excel & second datasource is a CDS entity “Contacts”. We want to insert or copy records from “List” to CDS entity “Contacts”

ForAll function : The ForAll function evaluates a formula for all the records if a table. 

Patch Function: Modifies or creates one or more records in a data source, or merges records outside of a data source.

Sample Code

ForAll(List,Patch(Contacts,Defaults(Contacts), {‘Address 1: Country/Region’:Aisle}, {‘Address 1: City’:’From Site’}, {‘Last Name’:’Created by’}) )

One thought on “Power Apps ForAll:Copy & Insert Records from One Datasource To Another Datasource”

Leave a Reply