How to get Reference field values in scoped applications

lucky6
Tera Contributor

Hi,

Actually i want to populate Assignment Group using current record reference field data , so in business rule it is working fine by using current.xyz, but while i am trying in Client script it is not working. Can we achieve dot walking in Client script? or can any one help me how ca we get reference fields data in client script or script include?

7 REPLIES 7

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Don't think this is a scoped applications issue like your topic title mentions.

Indeed you would need to use a Client Script and Script Include. Or g_scrathpad between a Business Rule and Client Script, if it's static data, could be better.

Here's an article which I wrote a while ago which describes using a Script Include with getXMLAnswer. Also contains detailed examples:
Client Side Scripting: Go for GlideAjax (with getXMLAnswer)!

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

LinkedIn

Dhananjay Pawar
Kilo Sage

Hi,

In client script only single dot walking is allowed.

And if there is multiple dot walking you have to use client script and script include combination.

Thanks,

Dhananjay.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

in client script you can only dot walk once.

There are other ways

1) GlideAjax and Script Include

OR

2) g_form.getReference() with callback method

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

DirkRedeker
Mega Sage

Hi

To give you some "jump-start", you can have a look at exsitings forms, where something similar is implemented. That way, you can train yourself on how ServiceNow did the implementation.

BR

Dirk