How many levels we can dot walk using current Api in business rule?

KM SN
Tera Expert

In case many levels is that good practice to beyond two layers?

5 REPLIES 5

Simon Christens
Kilo Sage

Hi @KM SN 

Pre Yokohama - the more you dot-walk, the more resources are used as it requires new Database queries the more you dot walk.

On Yokohama though a new method have been added to GlideRecord which decreases the amount of requests required to get dot-walked fields

GlideRecord - addExtraField(String dotWalkedField)

Queries one or more dot-walked fields from a form or script in a single request.

The addExtraField() method allows you to query dot-walked fields in a single database request, rather than perform multiple queries per dot-walked element in a form or script (which requires multiple round trips to the database).

 

See more here:
https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/app-store/dev_portal/API_referenc... 

This is okay if I am gliding the table to get the data, but I am writing a business rule where I am going for fourth level dot walk? so, I thought of asking the question is it good to go and how many level does the ServiceNow allows us to do?

 There is no strict limit on how many levels deep you can go, but it's strongly recommended to limit your dot walking to a maximum of 3 levels for optimal performance and to avoid impacting the system's responsiveness

Ankur Bawiskar
Tera Patron
Tera Patron

@KM SN 

you can dot walk as many level you want to achieve your requirement.

But remember it might impact performance if there are more records.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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