Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

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

(0) ShareShare
ReportReport
Posted on by 11

I'm trying to get birthDate (and other date fields) of portal user(contact) in liquid in a content snippet, it give me the error "Liquid error: Object of type 'System.DateTime' cannot be converted to type 'System.String'.

firstname and lastname works fine.

Any help?

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Liquid error: Object of type 'System.DateTime' cannot be converted to type 'System.String'.

    Hi Siddique,

    It's so strange.

    Maybe you can try to edit page in portal directly, not in the portal management.

    Log in portal with administrator, and go to the page you want to click 'Edit'.

    pastedimage1631256634636v1.png

    Open page copy dialog to add code:

    pastedimage1631256767089v2.png

    Save it.

    pastedimage1631256842927v3.png

  • Siddique mahsud Profile Picture
    11 on at
    RE: Liquid error: Object of type 'System.DateTime' cannot be converted to type 'System.String'.

    thank you Leah, for the quick response.

    I still get the same error, tried the same as you showed it's not working on my side.

    Code:
    pastedimage1631253585812v1.png

    Output:
    pastedimage1631253613658v2.png

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Liquid error: Object of type 'System.DateTime' cannot be converted to type 'System.String'.

    Hi Siddique,

    I can use {{ user.createdon}} to get create date of contact in liquid directly.

     pastedimage1631241347058v4.png

    pastedimage1631241389550v5.png

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans