Correcting/replacing values captured in list eVar through custom code
Hello,
We have a list eVar configured to capture the web form's field level errors, like "first_name", "company_name" etc.., when they are triggered. With the recent development change, some of these field name values are started to capture as unique number which looks something like this "00n5000000wfov".
Its because Dev had to change the hidden name of the inputs so that they would work with our salesforce systems. So, what used to be company_name for instance, is now 00n5000000wfov. And then any reporting/parsing of the data could probably be 'translated" that 00n5000000wfov to company_name.
Can anyone help on how i can replace/map the unique values to the actual field names, so the reporting is clean ?
Below is the custom code which i've tried but is not working:
s.list3=_satellite.getVar("form:formError");
var fieldMapping = {
'00n5000000wfov' : 'company name',
'00n4c000000d1rr' : 'test this replaced text',
'00n4c000000d1ru' : 'replaced with this text'
};
var capturedValue = _satellite.getVar('s.list3');
var replacedValue = fieldMapping[capturedValue] || capturedValue;
_satellite.setVar('s.list3', replacedValue);
Example of our list eVar the way it currently looks : "first_name:last_name:email:00n4c000000d1rr:company:employees:00n4c000000d1ru:00n4c000000d1rp:00n4c000000d1rs:00n4c000000d1rt:00n4c000000d1rq"
Any leads are much appreciated!
Thanks!

