- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2020 02:04 AM
use fix script to update all location records name field with comma separated existing value and country field value.
can anyone help .
Solved! Go to Solution.
- Labels:
-
Advanced Work Assignment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2020 03:53 AM
Hope you are doing good.
Did my reply answer your question?
If so, please mark it correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
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
‎11-07-2020 02:08 AM
Hi there,
Can you share what you've tried so far? Can you share where you are stuck? Can you share where exactly you need help with?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2020 04:31 AM
Hi,
Can you try below script:
var gr = new GlideRecord('cmn_location');
//gr.addQuery('sys_id', 'xsdsfdfeeffsfsfw345r'); // testing with one record
gr.query();
while(gr.next())
{
gr.name+= ", " + gr.country.getDisplayValue();
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2020 05:11 AM
Not sure what exactly is required but here are the steps for fix script
1) left nav type fix scripts
2) create new
3) Give name, select Run Once
4) Sample script below
updateLocation();
function updateLocation(){
try{
var gr = new GlideRecord('cmn_location');
gr.query();
while(gr.next()){
// your logic of updating here
}
}
catch(ex){
gs.info(ex);
}
}
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
‎11-19-2020 08:23 PM
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader