- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 02:37 AM
Hi All,
I am a beginner with ServiceNow.
I have a requirement to populate Employee number into SSO ID field in user profile (under sys_user table)
Attached is the screen shot.
Can you please help me with the fix script how should I populate the value from 'Employee Number' field to 'SSO ID' field on user profile form?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 02:54 AM
Hello @User375773
var gr = new GlideRecord('sys_user');
gr.query();
while (gr.next()) {
var x = gr.getValue('Employee_number_value');
gr.setValue('SSO_ID_value', x);
gr.update();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 02:52 AM
Hi @User375773 ,
Try this -
var userPro= new GlideRecord('sys_user');
userPro.query();
while(userPro.next()){
userPro.<backend name of SSO ID> = userPro.<backend name of employee number>;
userPro.update();
}
Please accept my answer and mark this helpful if it helps.
Regards,
Ankit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 02:54 AM
Hello @User375773
var gr = new GlideRecord('sys_user');
gr.query();
while (gr.next()) {
var x = gr.getValue('Employee_number_value');
gr.setValue('SSO_ID_value', x);
gr.update();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 03:00 AM
share the script you started
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 03:19 AM
• You can populate values of one field to another field in ServiceNow using the following methods:
• Using Transform Maps: Transform maps are used to map fields from one record to another. The ‘Map’ field type allows you to select a transform map that can be used to populate values from one field to another.
• Using Client Scripts: Client scripts can be used to populate values from one field to another. The ‘Script’ field type allows you to select a script that can be used to populate values from one field to another.
• Using Business Rules: Business rules can be used to populate values from one field to another. The ‘Business Rule’ field type allows you to select a business rule that can be used to populate values from one field to another.
For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/
For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER