I didn't know addEncodedQuery could be so DEADLY

Поділитися
Вставка
  • Опубліковано 6 жов 2024
  • 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...

КОМЕНТАРІ • 13

  • @robertthedukefedoruk5607
    @robertthedukefedoruk5607  Рік тому

    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

  • @aditya7428
    @aditya7428 Рік тому +1

    Great editing!

  • @palekarakshay
    @palekarakshay Рік тому +1

    Oh wow, did not know isValidEncodedQuery existed !! And love the edit. Thanks

    • @robertthedukefedoruk5607
      @robertthedukefedoruk5607  Рік тому

      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.

  • @mateobilandzija1847
    @mateobilandzija1847 Рік тому +1

    I love these Videos 😂😃 Fantastic content as always

  • @JeffPierce-u4g
    @JeffPierce-u4g Рік тому +1

    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

  • @danielc.oderbolz8754
    @danielc.oderbolz8754 Рік тому +1

    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.

    • @robertthedukefedoruk5607
      @robertthedukefedoruk5607  Рік тому +1

      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.

    • @danielc.oderbolz8754
      @danielc.oderbolz8754 Рік тому

      @@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.

    • @robertthedukefedoruk5607
      @robertthedukefedoruk5607  Рік тому

      ua-cam.com/video/XQxZnRwKcws/v-deo.html fixed

  • @anakcloudifs5374
    @anakcloudifs5374 Рік тому +1

    hahaha 1:35