web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • SD_Dev Profile Picture
    160 on at
    RE: How to Debug Liquid Template code

    Thanks.

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

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to Debug Liquid Template code

    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 $}


  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to Debug Liquid Template code

    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
    Lakshmisha Shetty Profile Picture
    on at
    RE: How to Debug Liquid Template code

    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
    Andreas Cieslik Profile Picture
    9,267 on at
    RE: How to Debug Liquid Template code

    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

  • MMK Profile Picture
    745 on at
    RE: How to Debug Liquid Template code

    Hi DSouza,

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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans