Reputation: 1
We have 2 data-verse tables named:-
Also we have 2 SharePoint lists named:-
The dataverse tables will contain the actual values and the SharePoint lists will act as the logs for the updates.
now we are trying to create a power automate flow which will update the SharePoint lists with what have been updated on the Invoices & Accounts dataverse tables (we are updating the dataverse tables using Power Apps canvas app).
So for example; let say a user update the InvoiceType field from "Personal" to "Enterprise" + update the InvoiceBalance from "10" to "20" and save the changes. so can we capture what has been changed using Power Automate flow and update the SharePoint lists accordingly . so in this case the Invoices_Logs SharePoint table will have this value:-
Invoice Type. old value = Personal / New value = Enterprise. Balance. old value = 10 / new value = 20
so can we have a Power Automate flow which run when dataverse item got updated and capture the fields that has been modified ? currently i am planning to do this inside the Power App, so i will store the old values inside a variable and when submitting the data i will compare the old values with the new values entered by the user. but this is a length work, so i am trying to do it in a smarter way using Power Automate, not sure if this is possible and how?
Any advice?
Thanks
Upvotes: 2
Views: 1286
Reputation: 5531
What you are trying to achieve is called "Auditing". This has been already taken care by Dynamics (dataverse) out of the box. Take a look at this MS docs for Auditing This should solve your challenge.
If in case you still want to perfrom these auditing in sharepoint, yes you can have a Power automate Trigger on update of Dataverse table, in your case Invoice or account table. This update trigger will give you only those fields which are updated.
Note: Power automate is Async operation i.e your power automate will fire after transaction is been perfromed i.e value is been updated and your power automate flow will not have previous value of the filed.
In short just with power automate your auditing logic of old and new value will not be sucess.
You will have to use plugins and use preImage and postImage in plugin so that you get both the values.
Upvotes: 1