How to pass a parameter from the current record into a Dynamic Filter?

ty_roach
Tera Guru

Use Case Example: Show me incidents where the caller has IT skills (i.e. from the cmn_skill table).

This seems like a perfect case for a Dynamic Filter (yes)?

Note - my real scenario is more complicated, but I think this gets to the point of it.

CMN_SKILL table showing the users with the IT skill.

find_real_file.png

In this case, I want to build a report on the incident table and have a dynamic filter that would show open incidents where the caller has IT skills.

So, I create a Script Include to hold my Dynamic Filter:

find_real_file.png

I was thinking I would need to pass in the user record in order to dynamically check if this person had the IT skill.  Here's the dynamic filter:

find_real_file.png

Notice the parameter I'm passing (this is where I'm having my problem).  How do you dynamically pull in the reference to the user record from whatever source table has the user reference field (i.e. such as the Incident table)??

Here's the report that attempts to use this Dynamic Filter:

find_real_file.png

There's no results because "current" is not defined.  Here's the message in the log file:

find_real_file.png

So...how would you pass the caller field to the dynamic filter??

Thanks in advance experts!

1 ACCEPTED SOLUTION

ty_roach
Tera Guru

Got to give Andrew Barnes (ServiceNow) props for an answer (this as far has he know😞 "dynamic filters can’t reference current - since they don’t know what current is - they are helping build what current is".

His thoughts for solving this problem were to create a dynamic filter that returns you all the sys_id’s of all the users with IT skill - which you can then pass into a Caller ‘is one of’.

That's actually a good idea, so I think I'm gonna go with that!

Thank you Andrew!

View solution in original post

2 REPLIES 2

ty_roach
Tera Guru

Got to give Andrew Barnes (ServiceNow) props for an answer (this as far has he know😞 "dynamic filters can’t reference current - since they don’t know what current is - they are helping build what current is".

His thoughts for solving this problem were to create a dynamic filter that returns you all the sys_id’s of all the users with IT skill - which you can then pass into a Caller ‘is one of’.

That's actually a good idea, so I think I'm gonna go with that!

Thank you Andrew!

Hi, I'm having a problem similar to yours in creating my dynamic filter and script include.

Do you mind posting the code image or explaining what functions you've put in the code to understand how to fix it?

Thanks for the help and Good evening