Select to view content in your preferred language

Unable to access attachments from AGOL hosted feature layer

1973
10
05-11-2023 09:44 AM
GIS_Admin
Occasional Contributor

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
10 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
Occasional Contributor

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
Occasional Contributor

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 - Principal Product Manager, ArcGIS for Microsoft
0 Kudos
LeviCecil
Frequent Contributor

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
Occasional Contributor

Thank you for raising this get attachment action.

What about the attachment parameter which is mandatory?

Best,

Oussama

0 Kudos
DanielArsenault
Occasional Contributor

I have the same issue with the attachment parameter, can't get it to work properly.

TimLohnes1
Frequent Contributor

Wondering if there is any further information on this @SeanKMcGinnis. Article/blog. What is the attachment parameter?

0 Kudos
dchan_GFCGIS
New Contributor

Hi all, 

I figured out what the "Attachment" should be.

dchan_GFCGIS_0-1740697711683.png

I hard-coded the Object ID (14) in this step.

Then, the attachment field will automatically give me the files associated with this item.

This is good, but if I were to use a variable in the Object ID field (such as within a loop), then, the Attachment field cannot find the files associated with the Object ID.  Thus, this "get attachment" is not that useful at all. 

Dan Chan