How can I dot walk in for a field on create a record action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2025 08:37 AM
Hello Experts,
As per attached image, I want to set user.email = user email coming from a action.
on red i want user.email = on green it is passing the user email. (it is correct).
how can I ?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2025 08:50 AM
Hi Chandra,
I am not following what you are trying to achieve. I guess you have a catalog item where a user can submit a request to add themselves to a group of their choice post approval? Can you share more details about the ask?
Regards,
Hitesh Patel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2025 08:58 AM
Hi @Hitesh Patel1 ,
I have created a action and this action fetching a user email from a azure group.
I want to create a record in sys_user_grmember table (OR you can say adding the member in service desk group).
you already know if we are adding a member in group both field are reference.
but I am fetcing email from azure and the same member already exist in sys_user table, how can create a group member record by email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2025 09:03 AM
you cannot set field value using create record
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-02-2025 09:29 AM - edited ‎05-02-2025 09:31 AM
It is working 😊 now
I have created a individual script action with follow script.
(function execute(inputs, outputs) {
var useremail = inputs.userEmail;
var group = inputs.group;
var userGr = new GlideRecord('sys_user');
userGr.addQuery('email', useremail);
userGr.query();
if (userGr.next()) {
var gr = new GlideRecord('sys_user_grmember');
gr.initialize();
gr.setValue('group', group);
gr.setValue('user', userGr.sys_id);
gr.insert();
outputs.recordsysid = gr.sys_id;
}
})(inputs, outputs);
Thank you!