You are welcome!! In this servicenow developer series you would find more use case videos on business rules,client script, script include and UI Actions which is already uploaded. For more complex use case please join my channel, I would start posting complex use case videos starting from this month. Keep watching and keep learning 👍
Hey Pritam thanks for the amazing content. I'm facing issues when we are using the setvalue with JSON function the code seems correct but the value is not updating in assigned. i face the same problem in the 'Return multiple objects from script include' video as well, please help me how can i fix this
Sometimes assigned to value not getting set, even after we are getting sysId of user. Tried alert for the sys id of user. Probably it could be cache issue
Hey 👋 Thank you for your comment !! I will surely do that in my complex use case video for ServiceNow. To get access on more use case join my channel now - ua-cam.com/channels/q9dV0PMEdQFzD4JTCNfK3A.htmljoin
Great 👍 informative video Sir😊, we need more use cases videos like this so that we can improve our scripting skill day by day. Thank you.
You are welcome!!
In this servicenow developer series you would find more use case videos on business rules,client script, script include and UI Actions which is already uploaded.
For more complex use case please join my channel, I would start posting complex use case videos starting from this month.
Keep watching and keep learning 👍
Thank you
You welcome !!
Keep watching and keep learning 👍👍
Hey Pritam
thanks for the amazing content.
I'm facing issues when we are using the setvalue with JSON function the code seems correct but the value is not updating in assigned. i face the same problem in the 'Return multiple objects from script include' video as well, please help me how can i fix this
Hey 👋
Can you possibly share the code you are using for client script and script include here in chat so that I can check and guide you further 🤓
Sometimes assigned to value not getting set, even after we are getting sysId of user. Tried alert for the sys id of user. Probably it could be cache issue
Yes it sould's like that only !! Try again and let me know 🤓
Thank you so much Pritham 🙏 please do more videos on integration as well.
Sure, will do it 😇
Hello Sir, requesting you to please add some script include scenarios which are used in catalog client scripts and development of catalog items.....
Hey 👋
Thank you for your comment !!
I will surely do that in my complex use case video for ServiceNow.
To get access on more use case join my channel now - ua-cam.com/channels/q9dV0PMEdQFzD4JTCNfK3A.htmljoin
I am practicing it and to me it is returning the last member of each group, How to tackle it now? I have refreshed as well but didn't work.
Hey..!!
That's strange..🤔🤔
Can you share your method from script include and client script here..?
@techwithpri
Method:
assignrandom:function(){
var usersobj={};
var fetchuser=[];
var grr=new GlideRecord('sys_user_grmember');
grr.addQuery('group',this.getParameter('sysparm_group_user'));
grr.query();
while(grr.next())
{
usersobj.sys_id=grr.user.toString();
fetchuser.push(usersobj);
}
return JSON.stringify(fetchuser);
},
type: 'GroupMmbersCount'
});
Client Script:
var ga2=new GlideAjax('GroupMmbersCount');
ga2.addParam('sysparm_name','assignrandom');
ga2.addParam('sysparm_group_user',g_form.getValue('assignment_group'));
ga2.getXMLAnswer(assignToRandom);
function assignToRandom(response2){
var obj=JSON.parse(response2);
if(obj.length>0){
var random = Math.floor(Math.random()*obj.length);
g_form.setValue('assigned_to', obj[random].sys_id);
}
else{
g_form.setValue('assigned_to','');
}
}
The code seems ok and also it is picking up random user from the group.
Try a group which has 7-8 members and let me know what is the outcome.