cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CalvinHew
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

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
Eelman
Super User
Super User

@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?

CalvinHew
Frequent Visitor

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.

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,439)