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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Liquid single item wit...
Power Pages
Unanswered

Liquid single item with variable to pass

(0) ShareShare
ReportReport
Posted on by 2,429 Super User 2025 Season 2

Hello everyone,

 

I want to know if it is possible to include one liquid variable into another liquid variable.

I came across that idea to find a faster solution passing the {{ user.id }} to retrieve the full contact information from the contact entity.

 

The code I tried to use:

 

{%assign exampleUserId = xyz-123-xyz-123 %}
{% assign textsingle = entities.contact[' + exampleUserId + '] %}

 

 

 The way "+ exampleUserId +" is not working.

In the end I would like to have a working solution for that line:

 

 

{% assign textsingle = entities.contact[' {{ user.id }} '] %}

 

I could not find anything to pass a liquid variable into another one. Anybody knows how that can work?

Categories:
I have the same question (0)
  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @Lucas001 ,

     

    Assuming that, you want to assign one variable to other. You can pass a liquid variable into another one using the "assign" tag. 

     

    Let's say you have two variables, "userId" and "variable2", and you want to pass the value of "userId" into "variable2". Here's how you can do it:

     

    {% assign userId = 'Hello' %}
    {% assign variable2 = userId %}

     

    Let me know if you're looking for something else.

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    Couple of things:

    • in the inner of the {% tag you do not use {{ you just use the the variable name
    • generally you would not include the the ' as your object is already outputting a string

     

    {% assign textsingle = entities.contact[user.id] %}

     

     

     Also the user object is already the contact object, so getting contact from user is pointless. The following is a quote from the doco

     

    user: Refers to the current portal user, allowing access to all attributes of the underlying Dataverse contact record. If no user is signed in, this variable will be null. More information: user

     

    https://learn.microsoft.com/en-us/power-pages/configure/liquid/liquid-objects

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard