cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Steelman70
Power Participant
Power Participant

Using the values returned by behaviour formulas (i.e. Patch)

How can we read/use the values returned by behaviour formulas such as Patch?

 

The reference article mentions this: "The return value of Patch is the record that you modified or created. If you created a record, the return value may include properties that the data source generated automatically."

 

I am not sure how to get the return value when associating a patch with an OnSelect of say a button.  This is useful to get the auto generated ID of a new item from a SharePoint list for example.

11 REPLIES 11

Thank you, All. 

Also wish there was additional/better documentation on this. 

The UpdateContext isn't what I am looking for as much as updating the actual Collection itself. 

How is that done? I don't think it is automatic, is it, unless one does a forced refresh: Refresh(Collection, SQLTable) ?

Hello, @murali 

Can you please iterate how we would update the collection as you specified:
UpdateContext({Submitted: Patch(....)})

 

We need to retrieve the RowId Identity value from the newly inserted rows (there could be many in the one insert) in SQL Server and update the "RID" column in our collection, with that RowId value?

 

We are using the following command to insert rows into SQL Server:

 

If(Connection.Connected,
Collect('[dbo].[Recommendation_Improved]', DropColumns(Filter(Recommendation, ActiveStatus="N"),"RID","ActiveStatus")));

 

The table is: [dbo].[Recommendation_Improved] (Identity seeded is RowId)

The collection is: Recommendation (Column to be updated is: RID)

Thank you.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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