Dynamically Populate a Field Based-on the Value(s) of Another Field

appstorm
Tera Contributor

I have been working on several on-change client scripts to make this work, but have so far been unsuccessful.  The task to make two fields that share the same table populate with their respective values, based-on the value of another field from the same table.

find_real_file.png

find_real_file.png

Below, is my script include.

find_real_file.png

 

How do I go about writing an on-change CS to make this work?

Thank you!

1 ACCEPTED SOLUTION

-O-
Kilo Patron
Kilo Patron

This is what I have defined in my PDI:

Hfind_real_file.pngHave added the fields to the Change Request form:

find_real_file.png

After flushing the cache, when I change System, Analyst and Owner automatically update.

View solution in original post

38 REPLIES 38

I suppose you also have Setter Field Definitions?

Check this link, https://www.ashleysn.com/post/service-catalog-data-lookup

Also the Matcher Field Definition is not OK: it should be a single line and you should select System from both tables (in both columns).

It is in the Setter Field Definition where you need to define into which fields the data should be set and where you will have two rows:

- Change Request System Owner.Owner into Change Request.Owner and
- Change Request System Owner.Analyst into Change Request.Analyst

-O-
Kilo Patron
Kilo Patron

Goes without saying that Change Request System Owner.System should have the same values as Change Request.System.

-O-
Kilo Patron
Kilo Patron

Once all definitions are done, it seems you need to flush the cache, so don't forget to do that too.