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

How do you modify a set of records

This documentation here:

Modify or create a set of records in a data source

Patch( DataSource, BaseRecordsTable, ChageRecordTable1, [, ChangeRecordTable2, … ] )

  • DataSource – Required. The data source that contains the records that you want to modify or will contain the records that you want to create.

  • BaseRecordTable – Required. A table of records to modify or create. If the record came from a data source, the record is found and modified. If the result of Defaults is used, a record is created.

  • ChangeRecordTable(s) – Required. One or more tables of records that contain properties to modify for each record of the BaseRecordTable. Change records are processed in order from the beginning of the argument list to the end, with later property values overriding earlier ones.

 

I have 4 columns: ID, Name, FieldType, Active

I am not ADDING any records, only updating records.

When user toggle Active, I'm trying to add that item to a collection, like so:

 

Collect(EditedRows3, {ID: ThisItem.ID,Active: ThisItem.Active, FieldType: ThisItem.FieldType, Name: ThisItem.Name})

 

Then on the save button, I do this:

 

Patch('[dbo].[SnapShotFields]',EditedRows3);
Clear(EditedRows3)

 

but when running the Patch command, I am getting error message FieldType: Field Required

Every item I have has a field type already set, and it's included in the collection. Any suggestions what I am doing wrong?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: How do you modify a set of records

Hi @dave-jorgensen

Try this:

Patch('[dbo].[SnapShotFields]', ShowColumns(EditedRows3, "ID"), EditedRows3)

This is because you need the second parameter to identify which records need to be modified.

I am assuming that ID is the primary key of your table.

 

Please let me know

View solution in original post

3 REPLIES 3
Meneghino
Level 10

Re: How do you modify a set of records

Hi @dave-jorgensen

Try this:

Patch('[dbo].[SnapShotFields]', ShowColumns(EditedRows3, "ID"), EditedRows3)

This is because you need the second parameter to identify which records need to be modified.

I am assuming that ID is the primary key of your table.

 

Please let me know

View solution in original post

Re: How do you modify a set of records

Thanks so much!

Meneghino
Level 10

Re: How do you modify a set of records

You are welcome, please visit my blog:

https://baizini-it.com/blog/

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,045)