Parent children fields dependent on Record Producer

Giovanni Tambur
Tera Expert

Hello everyone, I need to create two fields on a Record Producer connected to the cmn_location table, the first that shows me all the values of the locations that have no parent and the other that only shows me the values that have the Parent value selected on the first field.

The first field works, I configured it like this:

01.png

And it shows correctly the data I need:

02.png

The second field, on the other hand, I can't configure it correctly, on "Type Specification" I can't find adequate conditions for the filter. I added on "Auto-Populate" the dependency to the question where the Parent is selected but this doesn't help.

03.png

This shows all unfiltered values:

04.png

When in this case, selecting Belluno should only show the fields Piazza dei Martiri and Piazza delle Erbe.

Obviously this is just an example so I can't set a Reference qualifier condition

05.png

Do you have any ideas to suggest, maybe OOB.

Sorry for my English

Thanks in advance,

Giovanni

 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Giovanni Tambur 

So 2nd variable should show locations whose parent is the value selected in 1st variable?

if yes then add this in advanced ref qualifier on 2nd variable

javascript:'parent=' + current.variables.firstVariableName;

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

you are right, it was my mistake, the variable was not "site" but "location". I changed correctly to:
javascript:'parent=' + current.variables.location;
and now it works

10.png

Thank you very much

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Giovanni Tambur 

So 2nd variable should show locations whose parent is the value selected in 1st variable?

if yes then add this in advanced ref qualifier on 2nd variable

javascript:'parent=' + current.variables.firstVariableName;

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks for your reply.

My 1st variable is called "sito", I changed the 2st variable as follows:

06.png

Unfortunately I was on the Record Produces I do not get any results

07.png

@Giovanni Tambur 

are you sure the location Belluno has child locations?

Can you share that from locations table? how is Belluno related to Piazza dei Martiri and Piazza delle Erbe

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

yes I can confirm that they are connected:

08.png

indeed, I'll tell you more, from the opening page of the incident, I added the same fields and here it worked right away.

09.png