Unable to access attachments from AGOL hosted feature layer

532
6
05-11-2023 09:44 AM
GIS_Admin
New Contributor II

I am trying to author a flow where when a record is added to an AGOL hosted feature layer, I pull the attribute information and the attachment (photo) and email them to someone. Right now I use the When a record is created in a feature layer trigger then use the Fetch updates, changes, or deletions from feature layer action. This grabs all the attribute information, but will not return any attachments. The response shows an empty array:

FetchResult.png

When I use the REST endpoint of the service, I can see the attachment:

RestResult.png

I tried using the Get attachment action and it's greyed out since there's no data getting passed: 

GetAttachment.png

Lastly, I tried the Get data from feature layer action and still get nothing for attachments.

Am I missing something here? 

 

 

0 Kudos
6 Replies
jcarlson
MVP Esteemed Contributor

We use Make (formerly Integromat), and I'm not sure how different it is from Power Automate, but we just have our flow make a HTTP request to get attachments. Are you able to do something like that?

- Josh Carlson
Kendall County GIS
0 Kudos
GIS_Admin
New Contributor II

Quick response Josh! I can do the HTTP get to get the data, but was trying not to build it. I was hoping that the Get attachments action would get attachments

0 Kudos
ILoveMap
New Contributor III

I'm having the same issue, the fetch action is grabbing all of the expected attribute values but the attachments are empty. I had the same issue using the get attachment from URL 

0 Kudos
SeanKMcGinnis
Esri Contributor

Good Day All,

When it comes to the webhook handling, there is a bit of a difference in application than what I think the group is expecting. When using the 'When a record is created' webhook, it is only returning the details about the feature service where the record was created. It is unaware of the other derivative components that might have been created in the record creation workflow.

If you are looking to get the attachments in a flow that is triggered by the feature service webhook, you can use the 'Get attachment' action and pass the record's ObjectID.

SeanKMcGinnis_0-1687442371700.png

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
LeviCecil
Occasional Contributor III

Hi Sean,

Are there any tutorials on how to include Get Attachment into a "When A Record Is Created" email flow? Every time I try to add this action it creates another "for each" loop and doesn't work. 

Thanks!

0 Kudos
OussamaMerhi
New Contributor III

Thank you for raising this get attachment action.

What about the attachment parameter which is mandatory?

Best,

Oussama

0 Kudos