Export features to Excel

551
4
09-12-2023 04:27 AM
MariusVerdes
New Contributor III

Hi everyone,

I'm new to using ArcGIS for Power Automate and I'm wondering if it's possible to automatically export every feature that is added or edited in an Incident Reporting layer to an Excel spreadsheet in SharePoint.

I know there's a connector for ArcGIS Enterprise in Power Automate, but I couldn't find any triggers to export data to Excel.

I'm using ArcGIS Enterprise 11.1 and we have a Microsoft 365 E5 license.

Does anyone know if this is possible?

Thanks in advance!

0 Kudos
4 Replies
chaman1
New Contributor

Stakeholders requested a dashboard (because DE and DA are the same thing, am I right?), and the last feature they requested was an export to excel so they could build the same charts locally

0 Kudos
AdamAraza
New Contributor II

Hi MariusVerdes, this is definitely possible. Are you trying to make a living Excel document in a shared location that your users have access to, or are you sending a new Excel sheet for every record that is added/updated?

With both options, I do find it easier to store data in a SharePoint List first then give the users access to the List or write in your Flow to export the list to a CSV. 

If you want features added or updated on your spreadsheet instantly, you may want to make two flows, one with a trigger for "when a feature is updated" and one for "when a feature is added".

Another option would be to create a script using the ArcGIS API for Python and set it on a task scheduler. This wouldn't be triggered when records are added or updated, but if you set the time interval to a reasonable schedule, your users may not even notice.  Here's an example of some code:

import arcpy
from arcgis.gis import GIS
import pandas as pd
csv = 'file location of end product'

#Your enterprise credentials
portal = GIS(url="YourEnterpiseURL", username="yourUsername", password="yourPassword")

#access the layer
url = 'the layer you are querying'
layer = FeatureLayer(url)
feature_set = layer.query(where="1=1", out_fields = ','.join(fields))

#Convert to spatial data frame
sdf = feature_set.sdf

#Export to CSV
sdf.to_csv(csv, index=False)

 

 

0 Kudos
MariusVerdes
New Contributor III

Hi @AdamAraza

Thank you so much for the reply. I didn't think about the SharePoint list, I will have a look at that. As for your question, I would like to create a living / dynamic Excel document that will be updated every time a new feature is added to the layer or an existing one is updated. If you have any suggestions here, I would be happy to hear them.

Thanks again!

0 Kudos
AnthonyLatini
Esri Contributor

Hi @MariusVerdes . Just as a quick note. Please take a look at this blog post to get webhooks enabled in ArcGIS Enterprise 11.1. At the moment, there aren't any dedicated triggers associated with the ArcGIS Enterprise connector as webhooks are not officially supported until ArcGIS Enterprise 11.2. 

Enabling webhooks and Fetch Updates for ArcGIS Ent... - Esri Community

As for your inquiry - once you have the webhooks enabled, you can fetch the changes and then export them to any external system you want. SharePoint lists are extremely easy to work with are the easiest way to track and update information. There are connectors for Excel and can be used in conjunction with the ArcGIS connector. 

You can create your flow so that it captures anything new that has been created or that has been updated. Here is an example of what this might look like in your flow: 

Updating a record in a SharePoint list: 

AnthonyLatini_0-1699568769036.png

Create a new record in a list: 

AnthonyLatini_1-1699568960353.png

 

0 Kudos