We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Declarative action for related list UIB

IB3
Giga Contributor

 

Hello,

 

I’m working on a declarative action for a related list and I was able to display it on a specific table using a UXF Client Action:

 Screenshot 2025-09-18 131449.png

 

I configured the UserGivenTable correctly, and the modal dialog displays the desired table. The payload of the "Specify client action" currently looks like this:

{
  "label": "{{label}}",
  "userGivenTable": "{{userGivenTable}}",
  "table": "{{table}}",
  "parentRecordSysId": "{{parentRecordSysId}}",
 "relatedListName": "{{relatedListName}}",
 "hideSelectAll": "{{hideSelectAll}}",
  "parentFieldName": "{{parentFieldName}}",
  "referencedFieldName": "{{referencedFieldName}}",
  "extensionPoint": "{{extensionPoint}}",
  "view": "{{view}}",
  "columns":{{columns}},
  "type": "{{type}}" ,
  "query": "{{query}}"
}

  

 

Problems I’m facing:

 

Dynamic query for filtering:
I need to add a dynamic query to filter the records shown in the modal. In my case, the expected result should only be 2 records, but I’m not sure how to pass that query dynamically.

Screenshot 2025-09-18 131402.pngThe second problem:

When one or more records are selected, I want to:

  • Call Script Include with the selected sys_ids.
  • Execute some business logic form this SI .
  • Close the modal.
  • Refresh the related list.

I haven’t found where to configure this logic in the declarative action.

 

I also tried using a declarative_action_type Client Script to manipulate the form with JavaScript, but all parameters came through as undefined, so that approach didn’t work as expected.Screenshot 2025-09-18 132221.png

 

Any guidance on how to approach the dynamic query and the record selection → Script Include → modal close → refresh flow would be greatly appreciated.

@Brad Tilton – could you please provide advice on how to best handle this?

 

6 REPLIES 6

Hi @IB3 , You can use extension points to achieve it if you don't want to hardcode the query. Check my response on the other post.

https://www.servicenow.com/community/next-experience-forum/extension-points-in-declaritive-actions/m...

andrewbettc
Kilo Sage

Any joy in getting the thing to refresh?

Got it all working but, when I run my action the first time, the list refreshes but then, the next and subsequent times, it doesn't.