Filter User Field to Show Manager, Manager's Manager

jmiskey
Kilo Sage

I am trying to create a Catalog Item with (among other things) the following two fields: Submitter and Approver.

I want to put a filter on the Approver field, so it is dependent upon the Submitter.  Basically, the choices for Approver should be limited to:

- Submitter's Manager

- Submitter's Manager's Manager

I don't foresee having to go much further than that (although I would not be opposed to adding one level higher; the Submitter's Manager's Manager's Manager).

I am not sure what that filter would look like.  Can someone help?

Thanks

1 ACCEPTED SOLUTION

Here is the screenshot, use this as reference.

Script Include:

find_real_file.png

Variable where filtered result is required, for your case it is approver

find_real_file.png

 

Here is the output:

find_real_file.png

View solution in original post

9 REPLIES 9

Mandeep Karan
Tera Guru

Hi,

Try using script include, where you can return 'sys_idIN'+submitter.manager.sys_id+','+submitter.manager.manager.sys_id; call that script include in advance reference qualifier of your approver variable.

Regards,

Mandeep

That worked.  Thank you very much!  

OK, that did work, but I just came across something I didn't consider.  I am defaulting the Submitter to the current user, and it shows the managers for the current user in the Approver box.  However, if I change the Submitter to someone else, those filters do not seem affected, so it still shows the Approvers for the original person in the Submitter field, not the new one.

How can I get that to update?  I am thinking something like Catalog Client Script, but are not sure how we would affect the filters on the variable from it (I have a feeling I may be overthinking this and overlooking something obvious here).

Pass current.variables.submitter in your script include function as a parameter. It will make your filter dynamic.