Catalog UI Policy not working when the variable is mapped (Expert help please)

kevwatson
Giga Contributor

I'm configuring the out of the box Create Incident recorder producer.  You will see the variables I've created so far and I'm now at a point where I'm configuring Catalog UI Policies so some variables only show met certain conditions are met.

find_real_file.png

You will see in the attached image I've got two variables mapping to the same field within the Incident table.  This is deliberate and the choices that have been manually set in these reflect what's in that field so the mapping works correctly which it does. 

I've setup a Catalog UI Policy to hide the "Specify the hardware?" variable unless "Do you think this is hardware or software = Hardware" and this is working fine, see screenshots below.

find_real_file.png

find_real_file.png

However I now need to setup a Catalog UI Policy to hide the "Specify the software?" variable unless "Do you think this is hardware or software = Software", this is here I have a problem.  It seems because I'm mapping two variables to the same field I can't do this. 

find_real_file.png

If I remove the field mapping from the "Specify the software?" variable I can create the necessary Catalog UI Policy, however the choice selected then doesn't map into the Incident form which is required.

 

PLEASE HELP???

 

x

5 REPLIES 5

Mark Stanger
Giga Sage

The problem is that you have 2 variables that end up with the same 'Name' value (which is intended to be a unique ID).  The UI policy needs these values to be unique so that it can target each one individually to act upon it.  The reason you end up with duplicate 'Name' values is because the 'Map to field' checkbox hides and then takes over the variable naming.  In order to map a record producer variable value to a field, the variable name needs to match the field name exactly.  'Map to field' does this automatically for you.

So, when you map 2 variables to the same field you end up with 2 variables with the same 'unique' ID attribute...which will cause any UI policies or client scripts operating against that field to break.  It's probably also breaking your 'Map to field' capability too since the system wouldn't be able to distinguish which variable to choose from there.

So here's the solution...

For those 2 variables un-check the 'Map to field' option and give them a 'name' value that is unique.  Maybe 'hardware' and 'software' in your case.  This should fix your UI policy (but it will break your field mapping).  To fix the field mapping you can use the 'Script' field on your record producer form to map the field based on each unique ID.  Something like this should work...

// 'producer' is the record producer, 'current' is the record created
// If the 'hardware' variable is not empty map it to the 'Subcategory' field
if (producer.hardware) {
    current.subcategory = producer.hardware;
}
// If the 'software variable is not empty map it to the 'Subcategory' field
else if (producer.software) {
    current.subcategory = producer.software;
}

Mark Stanger
Giga Sage

Just checking on on this one.  Has this question been answered or is there more information I can help you with?  If it's been answered, please mark the answer above as the correct one so people know this has been taken care of.  Thanks!

kevwatson
Giga Contributor

This has now been raised on the HI Portal and they have proposed a solution I'm evaluating.

I'm curious what their proposal is?  Did you try the solution I proposed?