- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 11:55 PM
Hi everyone,
My requirement is to get sys_id of the field value from cases table to system property . Then I want to get this system property into widget and script include.
Does getValue work on system property .
My field name is "consumer " in cases table .
Thanks in advance
cc:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 12:55 AM
Hi Virendra
Try this
var callerCSM = gr1.getValue(consumer_contact.toString());
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 12:35 AM
Hi,
Members already shared the syntax on how to get system property value
what's the challenge in using that?
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
‎08-30-2022 12:47 AM
Hi
I am aware of the syntax on how to get system property . Kindly understand my requirement.
My requirement;
1. I have one field called "consumer " on cases table . This is reference field and stores user's name .
2. Now I have created system property as you have seen above to get string consumer into widget .
3. In widget I have to draw system property , which I have done .
4. I have to get sys_id of that user which is in consumer field using system property
so in above code when I am using : var callerCSM = gr1.getValue('consumer_contact');
My expectation is to get sys_id of that user which is stored in consumer field . But I am getting null .
And I know many will suggest that I can directly access that field from widget without using system property but my requirement is in such a way that I have to use system property.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 12:50 AM
Hi,
since that field is reference then it will always hold sys_id
are you sure "consumer_contact" field name is correct on work order table?
Are you sure data is present in that field?
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
‎08-30-2022 12:55 AM
Hi
Field is "consumer" on cases table . But I have to get consumer string into system property and then I am calling system property using consumer_contact . Then the using consumer_contact to get sys_idof that user. consumer_contact is variabl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 12:56 AM
Hi,
system property holds field name
So update as this
var callerCSM = gr1[consumer_contact];
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader