Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

{Portal} Error while accessing fields using liquid

(0) ShareShare
ReportReport
Posted on by 55,410 Moderator

I am trying to retrieve the entity records using fetch xml/ liquid within a web template. This works fine accept that for one decimal field, I am getting the below error.

Liquid error: Object of type 'System.Decimal' cannot be converted to type 'System.String'.

How do we convert decimal objects to string in liquid?

I am referring this blog post: dyn365apps.com/.../dynamics-365-portals-liquid-templates-part-3-retrieve-data-using-fetchxml

Here is my current liquid code. new_amount is the decimal field

===

{% for result in my_query.results.entities %}
<div name="main-content" style="margin-left: 300px; max-width: 800px;">
<h1> {{ result.new_name | escape }} </h1>
<h2> {{ result.new_amount | escape }} </h2>              
</div>
{% endfor %}
=========

*This post is locked for comments

  • Milansinh Raj Profile Picture
    230 on at
    RE: {Portal} Error while accessing fields using liquid

    Hey Ravi Kashyap,

    I am facing same issue for entity reference type value.

    I want to get that record id of entity reference field.

    What should i do ?

    result.questionid

    Thank you,

    Milansinh Raj

  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: {Portal} Error while accessing fields using liquid

    {bump}

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: {Portal} Error while accessing fields using liquid

    It turns out that we can simply convert it decimal to string as follows-

    {{ result.new_amount | string }}

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans