Get Attachments on record Action is not working

Anandini
Tera Expert

Hi,
I’ve created a custom table named u_cg_legal_request. In my Flow Designer flow, I’m using the ‘Get Attachments on Record’ action to retrieve attachments from records in this table. However, the action is consistently returning a count of 0 attachments, even though the record definitely has files attached.

This issue seems to happen only for this custom table. It works fine for standard tables like incident.

Is there something specific I need to configure for the custom table to make this action work? Any help or insights would be appreciated.

Thanks!

 

Anandini_0-1746456255991.png

 

Anandini_1-1746456308387.png

 

Anandini_2-1746456399263.png

 

1 ACCEPTED SOLUTION

Aditya02
Tera Guru

Hello @Anandini ,

 

File name Data type: String

Search string containing a partial or entire file name of an attachment file. You can use this input as a query filter to find one or more attachments that have the listed file name. If you leave this input empty, the action returns all attachments associated with the source record.

Here, Check weather the file exists or not with the name you are giving. I think there is no file exist with that name thats why It was returning as zero. If you want all the attachment to retrieve You have to left as empty.

 

You can refer this article: Get Attachments on Record Action 

 

If My suggestion helps to get out of this issue, please mark it as the answer and hit the thumbs-up to help others find it too!

 

Thanks & Regards,

Aditya

 

View solution in original post

11 REPLIES 11

Joe Dames
Tera Expert

Is the  ‘Get Attachments on Record’ scope safe? If your script is running in a scoped app and attempts to use a global object via GlideAggregate (e.g., referencing a table that only exists in global scope), ensure the table is actually accessible.

I think GlideAggregate will not return data unless explicitly permitted via cross-scope privileges.

hello @Joe Dames ,

I am using global scope only. I'm not using scoped application. Everything is in Global itself.. Here you can check that the table I'm running flow is in global.

 

Anandini_0-1746459897648.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Anandini 

that action seems to be a custom action as I am unable to find that in flow designer.

I could find only these ones

AnkurBawiskar_0-1746460836539.png

So please check the logic within that custom action and how it's getting the count.

Share the script and configuration.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

hello @Ankur Bawiskar ,

 

Its not a custom action. Its OOB only. I didn't create anything..

 

Anandini_0-1746466325512.png