cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Updating SharePoint List Column

I have tried different methods to update multiple records in a SharePoint List, with a condition and update a specific column with a value..

 

I would like to know if Power Apps has a function that is similar to a SQL Update statement, without delegation issues. Those articles I'm reading are more than a year old.

 

Eg. UPDATE Cities SET Location = CONVERT(Point, '12.3:46.2') WHERE Name = 'Anchorage';

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Updating SharePoint List Column

Hi @CalvinHew ,

Yeah, you are right. The UpdateIf function is a non-delegable function in PowerApps. If the amount of your SQL Table records is not more than 2000, you could ignore the Delegation warning issue.

Note: Please make sure you have set the "Data row limit for Non-delegable query" option to maximum value -- 2000

 

If the amount of your SQL Table records, you could consider bulk-load your SQL Table records into a collection in your app, then use the collection as data source in your app instead of the original SQL Table data source. Please check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Pulling-in-large-ish-SQL-tables/m-p/243777#M7...

 

In addition, you could also consider use the following formula to update multiple records in your SQL Table:

ForAll(
       RenameColumns(Filter('[dbo].[Cities]', Name = 'Anchorage'), "PrimaryKeyColumn", "PrimaryKeyColumn1")
       Patch(
             '[dbo].[Cities]',
             LookUp('[dbo].[Cities]', PrimaryKeyColumn = PrimaryKeyColumn1),
             {
               Place: "Town"
             }
       )
)

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Resident Rockstar
Resident Rockstar

Re: Updating SharePoint List Column

@CalvinHew 

The Patch() functions modifies or creates a record or set of records, is that what you mean? I have done a lot of SQL so can't fully understand your code. If you explain what your SQL code is doing or what you are trying to achieve I may be able to help?

Highlighted
Frequent Visitor

Re: Updating SharePoint List Column

Hi,

 

The Patch() functions modifies or creates a record or set of records, is that what you mean? - That's right

 

My SQL statement selects multiple records based on a condition/filter (WHERE Name = 'Anchorage'), and then update the table Cities, column Place of those records to "Town". (I'm giving another more straight forward eg)

 

UPDATE Cities SET Place = "Town" WHERE Name = 'Anchorage';

 

This type of update is a standard SQL function, but Power Apps seems to be lacking. Patch is difficult to update multiple records. UpdateIf has delegation issues.

 

Thanks.

Highlighted
Community Support
Community Support

Re: Updating SharePoint List Column

Hi @CalvinHew ,

Yeah, you are right. The UpdateIf function is a non-delegable function in PowerApps. If the amount of your SQL Table records is not more than 2000, you could ignore the Delegation warning issue.

Note: Please make sure you have set the "Data row limit for Non-delegable query" option to maximum value -- 2000

 

If the amount of your SQL Table records, you could consider bulk-load your SQL Table records into a collection in your app, then use the collection as data source in your app instead of the original SQL Table data source. Please check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Pulling-in-large-ish-SQL-tables/m-p/243777#M7...

 

In addition, you could also consider use the following formula to update multiple records in your SQL Table:

ForAll(
       RenameColumns(Filter('[dbo].[Cities]', Name = 'Anchorage'), "PrimaryKeyColumn", "PrimaryKeyColumn1")
       Patch(
             '[dbo].[Cities]',
             LookUp('[dbo].[Cities]', PrimaryKeyColumn = PrimaryKeyColumn1),
             {
               Place: "Town"
             }
       )
)

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

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

Top Solution Authors
Top Kudoed Authors
Users online (10,676)