UI Builder - how to use sys_attachment table in Data resource - Aggregation Query

Marcin20
Mega Guru

Hi,

 

I am trying to create a Data resource - Aggregation Query to get the number of attachments related to a given record.

However, I cannot select the sys_attachment table in the 'Table' field.

Please could you help me how to make this table selectable?

 

Best Regards,

Marcin

3 REPLIES 3

Diogo Ramos
Giga Sage

I'm not sure about the reason but I found that if you create a client state with the name sys_attachment, and you pass that to the input of the aggregation it will work. The drawback is that if you do this, then you have to create client states for some of the other inputs of the data resource, as UIB does not seem to support a mix between client state and static inputs for some reason.

I hope it works 🙂


Shivalika
Mega Sage

Hello @Marcin20 

 

In ServiceNow, the sys_attachment table is a system table, and by default, system tables are restricted from being used in certain features like Aggregation Queries in Data Resource.

 

But can you tell me why you would need this , what's the requirement exactly ? 

 

LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

YouTube - https://youtube.com/@servicenowdeveloperr?si=vd71G8qYXBgYDCCz

 

Please mark my answer as helpful if you found it helpful in anyway  🙂

 

YouTube - 

Shivalika
Mega Sage

Hello @Marcin20 

 

Kindly accept solution if it helped you so that this can be moved from unsolved bucket to solved 😊

 

Regards,

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY