I didn't know addEncodedQuery could be so DEADLY
Вставка
- Опубліковано 9 лют 2025
- If addEncodedQuery doesn't have a valid query string, ServiceNow will NOT stop the query. This could mean you query WAY more records than you intend. Scary proposition if you're doing updates or deletes on a table via script! Here we explore the damage that can be done, and how to prevent it.
API Docs for isValidEncodedQuery: developer.serv...#SGR-isValidEncodedQuery_S
Looking for #ServiceNow talent or opportunity?
🤝 Need coaching or mentorship? theduke.digital...
👑 Duke Digital Media sponsorships & consults: theduke.digital
👑 Write your resume like a KING: theduke.digital...
💥 My 1500+ subscriber ServiceNow mailing list: bit.ly/fedoruk
🔗LinkedIn: / rfedoruk
🎙️ CJ&TheDuke Podcast: feeds.transist...
💎Donations: paypal.me/robf...
Watch your other query methods too! .get() is risky as well! ua-cam.com/video/WxszcO3aKPE/v-deo.html
If you want more technical ServiceNow content, check out my Toolbox playlist: ua-cam.com/play/PLkQDoKoP0MAP0gwpL2OEMZJzmm7t872th.html
Great editing!
Oh wow, did not know isValidEncodedQuery existed !! And love the edit. Thanks
You're welcome. Technically I didn't know either until one of the guys on SnDevs slack was telling me about it. Game changer though.
I love these Videos 😂😃 Fantastic content as always
Thanks Mateo! Shares are always appreciated!
Also, always do a dry-run that doesn't update anything but only outputs logs. but i know, this is a video about encoded queries. shorf ure, i mean surefor, i mean for sure
Truth! Dry runs are importnat
Dear Duke
Thanks a lot for this valuable video!
I want to add one tiny thing:
There is a property to control this: glide.invalid_query.returns_no_rows
Set this to true to avoid this issue.
I'd argue its still a good idea to check the return. "Just return zero" doesn't mean your code knows what to do with that.
Also, for the indie consultants out there, may not have the option to arbitrarily turn on properties.
@@robertthedukefedoruk5607 Agreed that this is not a Panacea. But it might be easier to turn on a property rather than fixing all the code that does not check the validity of the encoded query. It's just an additional safety net.
ua-cam.com/video/XQxZnRwKcws/v-deo.html fixed
hahaha 1:35