cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerPedro
Regular Visitor

How do I fecht URL query params in liquid in order to index a data entity?

Hi,

 

I am just starting with Power Portals and I have this question. In one page I have a list component where I display an entity, when I click in one record I want to show the details in another page. 

 

With this code I can access the entity:

 

{% assign object = entities.cr21d_object['90153843-bb6c-eb11-8fed-0003ff1d219a'] %}
{% if object %}
Object found
{{ object.cr21d_name }}
{% endif %}
 
but I am missing the point who I get the ID that I see in the URL query in order to pass through the appropiate id.
 
The query looks like this:
 
xxxx.powerappsportals.com/objects-1/view-objects-1/?id=90153843-bb6c-eb11-8fed-0003ff1d219a
1 ACCEPTED SOLUTION

Accepted Solutions
mbayes
Resolver I
Resolver I

Hi Pedro,

 

There is an object in liquid called "request". The "request" object contains all information about the URL, parameters, etc. that you will need.

In order to retrieve the parameter, all you need is the following line:

{% assign requestId = request.params.id %}


If your parameter was called "recordid", for example, the code would look like:

{% assign requestId = request.params.recordid %}

 

I hope this helps, and feel free to ask me any questions you might have!

Thanks!

 

Matt Bayes

View solution in original post

2 REPLIES 2
mbayes
Resolver I
Resolver I

Hi Pedro,

 

There is an object in liquid called "request". The "request" object contains all information about the URL, parameters, etc. that you will need.

In order to retrieve the parameter, all you need is the following line:

{% assign requestId = request.params.id %}


If your parameter was called "recordid", for example, the code would look like:

{% assign requestId = request.params.recordid %}

 

I hope this helps, and feel free to ask me any questions you might have!

Thanks!

 

Matt Bayes

View solution in original post

PowerPedro
Regular Visitor

Hi Matt,

 

Thanks. I already solved it in a similar way:

 

<div class="col-md-4 columnBlockLayout" style="display: flex; flex-direction: column;">
      {% assign objectId = request.params['id'] %}
      {% assign object = entities.cr21d_object[objectId] %}
      {% if object %}
      <b>Store</b>
      {{ object.cr21d_name }}</p>
      <b>Country</b>
      {{ object.cr21d_country }}</p>

Apart from that I had to assing Entity Permissons in the Portal Management or I would get empty results.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,285)