web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to Debug Liquid Template code

(1) ShareShare
ReportReport
Posted on by

Hi All, I wanted to know if there is way to debug the liquid template code that i have used in creating a web template?

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • MMK Profile Picture
    745 on at

    Hi DSouza,

    I am also having the same query did got your answer ?

  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    There is not a lot that you can do, but to use console.log statements.

    Maybe this page provides you a helpful snippet to log variables for debugging purposes more easily:

    github.com/.../121

  • Suggested answer
    Lakshmisha Shetty Profile Picture
    on at

    Hi Lester,

    You can not debug the Liquid templet. However you can use browser devloper console to check the values and your conditions.

  • Suggested answer
    Community Member Profile Picture
    on at

    There is no known way to debug a liquid template, since it is client side scripting.

    Although you can use browser developer tool as suggested.

  • Suggested answer
    Community Member Profile Picture
    on at

    I've found the easiest ways are:

    For an attribute/property - to insert the values into the DOM:

    <p>{{object.attribute}}</p>

    or if you'd rather nobody saw your testing:

    <p style="display: none;">{{object.attribute}}</p>


    For a condition, alert or log something

    {% if youLikeBananas == true %}
      alert("They're good and good for you.")
    {% endif %}

    again, if you'd rather nobody saw it

    {% if youLikeBananasAndDontWantAnybodyToKnow == true %}
      console.log("You're no fun :( ")
    {% endif %}


    What I'd really like is to know how to inspect an entire object when you're not certain of its available attributes; for example...

    {{entity['fruit basket']}} {$ comment %} show me all of it's goodness {$ endcomment $}


  • SD_Dev Profile Picture
    160 on at

    Thanks.

    But how do I check it from the browser? console.log() doesn't really help.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans