“Common Data Service” connectors don’t have an “Upsert” action:
And it would have been a problem for one of the flows I had to implement recently if not for David Yack who pointed out that Update action will do an Upsert.
What??
Well, he was absolutely right, here you go:
Have fun folks. And thank you, David.
HI Nice solution but I punishing my head to retrieve if a record already exist in the entity… So far I found only a solution to use the ‘List Rows’ action to setup a filter to retrieve one record based on a filter. When Found update otherwise create.
Using ‘List rows’ action an update action that referencing the outcome of the ‘list row ‘ results in a for each loop with an update action inside. But the for each action is never evaluated if list row action found no match 🙁
any suggestions ?
regards Bert
I just do a “List rows” and then create a condition.
In the condition I put expression : empty(outputs(‘List_rows)?[‘body/value’]) is equal to “true”
If yes -> Update account (with a random guid, so bascily “create)
if no -> Update account
This works just fine….
While it’s a neat trick, one quick note on this approach; it can impact the performance of your instance in the long run as you shouldn’t arbitrarily create unique identifier for Dataverse records – this could make it more difficult to index and page the data in the background.
I’d let the platform handle the GUIDs, and look into whether it is possible to use an alternate key instead. Even if an alternate key approach is not possible in a cloud flow, I think the list rows + filter + conditional split is a simple-enough solution to mitigate the performance costs.
Kind regards,
Mehmet
Thanks Alex! That was a great tip and just what I was looking for.