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
Anonymous
Not applicable

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

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.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,068)