Fortunately my level of trust with anything new on the Power Platform is near zero. Everything must be tested before I will rely upon the most basic features available. This caution paid off today in that I only wasted about 15 minutes before figuring out the problem.
I was getting the error: The function 'Patch' has some invalid arguments. The specified column X does not exist. The column with the most similar name is X.
The issue? You cannot (currently) Patch() a record from a Collection to Teams Dataverse (but you can to SharePoint, SQL, etc...)
Oddly enough, both work fine connecting to the standard Dataverse (non-Teams).
NOTE: I have a "fix" from MS and will detail below
Here's the gist. If you're the kind of person like I am and you prefer to build out your data structures before you write them out to your data source to make 100% that you are doing what you think you are, then you store the record you're planning to write out to said source in a Collection first.
So while the following code would work fine if writing to SharePoint, it does not work using Teams Dataverse (as of 2021-06-29).
The "Fix"
If you've ever wrestled with some complex statements that are referencing values within multiple objects that are external to your PowerApp, then you know that MS needs to fix some ways in which we reference these values if we want to be explicit vs. "hoping" that the specific field name we're referencing actually belongs to the Object/Container that we imagine it does.
I really don't like that I have to force a reference to the Datasource I'll ultimately write to because that really forces us into a corner per how/when you build a Collection to write from. However, as I almost always do this in the lines right before I write out to the Datasource, and this is only done w/ that as the purpose, I think this might be reasonably acceptable.
But I also now wonder what this might look like if I threw it into the JSON() function...
No comments:
Post a Comment
Because some d-bag is throwing 'bot posts at my blog I've turned on full Moderation. If your comment doesn't show up immediately then that's why.
DIAF Visualpath team