Dynamic Filter for Data Table from Instance Definition widget (Portal)

JJG_SNOW
Mega Guru

I have a 'Data Table from Instance Definition' widget on a portal page. It links to a table and displays records that match the filter. I would like to call a script include from the "Filter" field, to return a list of sys_ids for the widget to display.

 

I have done this before on record producers and catalog item variables via this method in the reference qualifier:

 

javascript:scriptIncludeName.functionName(variable_name_goes_here)

 

 

This doesn't seem to work in the portal widget however. It displays the same records whether I call the script include or not. I have thoroughly verified that the code in the script include is correct. This implies that javascript reference qualifiers are not allowed in the filter field. Does anyone have any info on this / work around?

 

This is what I am using in the filter field: 

 

javascript: ProjectOverview.getCases(gs.getUserID())

 

 

JohnGilmore_0-1700493593968.png

 

 

1 ACCEPTED SOLUTION

Ethan Davies
Mega Sage
Mega Sage

 

new ProjectOverview().getCases(gs.getUserID())

 

If you're calling a Script Include, try the above syntax after your 'javascript: '

 

Note that your function will need to return a list of comma-separated sys_ids.

View solution in original post

6 REPLIES 6

Peter Bodelier
Giga Sage

Hi @JJG_SNOW 

 

Could your try:

javascript: ProjectOverview().getCases(gs.getUserID())

 

I know this works in the simple list widget, so I would be surprised if it doesn't work here.
Just to make sure, you have verified your script include does work (in a backend filter for example)?

 

Could you share your script include, so I could reproduce?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Same result with what you suggested

Ethan Davies
Mega Sage
Mega Sage

 

new ProjectOverview().getCases(gs.getUserID())

 

If you're calling a Script Include, try the above syntax after your 'javascript: '

 

Note that your function will need to return a list of comma-separated sys_ids.

@JJG_SNOW the difference between the above and yours in the 'new' before invoking the Script Include, and the addition of the '()' after invoking the Script Include name and before calling the method for getting cases.