In the following expression, the first Patch function works, but the other two do not.
Clearly this is a bug, since the first argument of Patch can be a record or a table/collection. Please see highlighted error.
Any ideas welcome.
Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ])
DataSource – Required. The data source that contains the record that you want to modify or will contain the record that you want to create.
I think you might missed some points, the first argument could be a datasource, or a collection.
Some more information:
In your app, you'll use formulas to create, update, and manipulate records and tables. You'll probably read and write data to an external data source, which is an extended table. In addition, you might create one or more internal tables, which are called collections.
Please try to add table function with the Current_A (and current_B), see if that would help.
Hi @v-micsh-msft, thanks for getting back to me.
Please see documentation here.
It clearly states: "Even if you're not working with a data source, you can use Patch to merge two or more records"
The syntax is explained in the page and states: Patch( Record1, Record2 [, …] )
It works in the first instance but not in the other instances of my example.
Thanks for the remindings.
I will take some tests from my side and update later.
See the test results:
No corresponding errors popped out from my side.
Would it be related to the collection name?
May you take a try to change the two collection names without the "_"?
I'm experiencing something very similar, where a patch call is changing the type of the context variable to be a datasource/collection, which conflicts with all uses of the variable, since it is indeed just a record. If I remove the call, it will re-evaluate and treat the variable as a record, and then paste back in, it will again, treat it as a record and the app will work. Saving the app will not fix the issue going forward.
Did you get your issue resolved?
Did you find a work around?
As a work-around, have you tried creating a collection, populating it with your context variable, performing the patch on the collection and then assigning the one row of the collection back to the context variable (using First or LookUp to return a record datatype)?
@PaulD1 I saw that in another location in the app, I bet that is why and I bet it would work. My current work around is to do another lookup for the object out of the gallery.
I'm currently fighting for this to be considered a bug, and for it to get prioritized.
Check out new user group experience and if you are a leader please create your group
Check out how to claim yours today!
We are excited to announce that Demo Extravaganza for 2021 has started!
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks