Select to view content in your preferred language

Update hosted table from Excel file using Power Automate

98
1
Tuesday
bbaker_tngeo
Regular Contributor

I'm not sure if this is possible, but I am trying to create a flow that would perform all steps of a workflow instead of just the initial step. Here's my scenario:

-Automated email gets sent from a 3rd party software with a summary of assets

-Power Automate gets the attachment, uploads it to Sharepoint, and then cleans up the headers and other unnecessary rows using an Office Script

-List rows in the Excel file

-Get data from feature layer

 

This is where I get stuck. The end goal is to compare the Excel table to the hosted table and get 2 arrays - one that has records in the Excel file that are not in the hosted table (adds) and records in the hosted table that are no longer in the Excel file (deletes). The records that persist do not need to be updated, as there are additional fields in the table that are updated in Portal once a record is added to the table.

 

Ultimately, I want to be able to use the Add records to a feature layer and Delete a record from a feature layer actions with the arrays described above, but am not sure how to get to this point. I have tried using a series of Select actions followed by a Filter array, but it doesn't return what's different. I am thinking it has to do with how the data is being returned as an object instead of a list of strings.

 

I have a python script that will do exactly what I need it through via pandas, but I would like to keep it all within Power Automate, if possible, so I don't have to maintain 2 separate components. Does anyone have any ideas that might get me on the right track?

0 Kudos
1 Reply
AkshayHarshe
Esri Regular Contributor

I am assuming that you have some common field names in both your feature layer and excel collection. If you don't then you might need few additional steps. One of your array comes from the excel and the other from the get data from feature layer action.

For creating and comparing arrays I found this blog which might help: Quickly Comparing Two Arrays in Power Automate and Logic Apps – William's IT Blog 🍉

You can also consider to start a flow by triggers like when a file is modified in Share point or OneDrive connectors

Thanks,
Akshay Harshe
0 Kudos