- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 12:11 PM
Hello all,
I wonder if anyone can shed any light on the below issue ?
Record update - I'm updating some records via transform maps, One of the field maps is using an IF statement (example below : This used to work fine but now when i run my data in i am getting an issue:
Issue - Values are displaying correctly on the form but if i look at the record in list view the field in question shows as empty.
The strange thing if i got into the record and press the update button the the field shows correctly in the list view.
Example IF statement
if (source.u_status == 'Deployed') {
target.operational_status = 1;
target.hardware_substatus = "";
target.u_reason = "";
} else if (source.u_status == 'In Requisition') {
target.operational_status = -1;
target.hardware_substatus = "";
target.u_reason = "";
Can anybody shed any light on what the fix would be for this ?
Ive updated my if statement to a know working version but it still doesn't work
Solved! Go to Solution.
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 12:30 PM
Hi Joshua
The above logic should be written in script part of your transform map and not in field mapping.
Also for the details that you are able to look on form and not on list - can be because of onLoad scripts that are setting the value on form and onSave/submit the values will be stored and you will be able to view them from list view.
To check what scripts are running - use field watcher on specific field and get the script that's populating the value.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 12:25 PM
I see you're trying to update multiple fields on one field map. What's the target field set to on your field map?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 12:27 PM
Hi, unfortunately your post does not contain clear details of your impacted records and it is this you need to look at first, as even if the transform script was incorrectly populating a value into your 'choice?' field I would expect the list view to show the value in blue text indicating the content but that the value is not found in the choice list.
As a first step I would check xml of the (saved) target record to confirm that the field is populated, if it is not populated in xml view then the most probable cause is a client script is populating the form value on load and your description of the field becoming populated once you update seems to support this as being the cause.
If not a client script issue, then perhaps you can update this thread to include clear and specific details of your issue and configuration?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 12:30 PM
Hi Joshua
The above logic should be written in script part of your transform map and not in field mapping.
Also for the details that you are able to look on form and not on list - can be because of onLoad scripts that are setting the value on form and onSave/submit the values will be stored and you will be able to view them from list view.
To check what scripts are running - use field watcher on specific field and get the script that's populating the value.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 12:41 PM
Thanks, I re-wrote as part of a script in transform map This resolved my issue.