- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2022 12:29 AM
I have a requirement that is-
If the target field value is empty then only return the source.field value to the target field.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2022 12:46 AM
Hi,
you can try to access it; if it doesn't work then don't use field map for that target field
instead use onBefore transform script
if(target.fieldName.nil()){
target.fieldName = source.u_fieldName;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2022 12:46 AM
Hi,
you can try to access it; if it doesn't work then don't use field map for that target field
instead use onBefore transform script
if(target.fieldName.nil()){
target.fieldName = source.u_fieldName;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2022 12:51 AM
Hi,
I am using if(target.fieldName=='') ..because I am trying to find out if the dropdown is --None-- then only return else ignore or do nothing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2022 02:05 AM
Should be fine
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2022 03:37 AM
Hi ED,
For None the backend value is blank so you can mention
if(target.custom_field==''){
target.custom_field=source.field;
}
For your help
https://community.servicenow.com/community?id=community_question&sys_id=894917bedbd4e3882be0a851ca961957#:~:text=%2D%2DNone%2D%2D%20is%20blank.,-You%20can%20select