cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThareLyn
Helper I
Helper I

Liquid not getting all the records from entity

It is only returns 10 records even I have like 30+ records

ThareLyn_0-1623065252734.png

 

Mycode is:

ThareLyn_1-1623065351174.png

 

Does anyone knows the problem in here? Please help. Thanks.

7 REPLIES 7
OliverRodrigues
Super User
Super User

In your entity list itself, can you check the page size? By default that is set to 10 records, so basically you need to add paging to your Liquid code, or simply increase that configuration

 

If you need to add paging, the official documentation shows an example on how to do it: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/render-entity-list-current-page

 




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.

Power Apps Portals Super User


Oliver Rodrigues


 

ThareLyn
Helper I
Helper I

Well to be honest. I put a 3 on page size

ThareLyn_0-1623066930205.png

Because I only need to get the most recent 3 items that the current portal user owned.

But still returns 10 records. I also tried to put 99 on that and still returns 10 records.

ThareLyn_1-1623067136403.png

 

OliverRodrigues
Super User
Super User

Have you cleared the cache after changing the configuration? If yes, then that sounds like a bug.

 

What you can do here is use the forloop object and check the index:

https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects#forloop

{% if forloop.index < 3 %}
.....

not sure there is a break instruction in Liquid, I think perhaps it's not available in the version for Power Apps Portals




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.

Power Apps Portals Super User


Oliver Rodrigues


 

Hi @ThareLyn  and @OliverRodrigues

There is a limit parameter that allows to exit the loop: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/iteration-tags#parameters . For example this will exist loop after third item:

{% for child_page in page.children limit:3 %}

<a href={{ child_page.url }}>{{ child_page.title }}</a>

{% endfor %}

Regarding the entitylist - there is a parameter on the entityview called pagesize which should take the date from Page Size field. I think this is not happening as you are rendering liquid and not passing this parameter. Please take a look on this official example from MS on how to render a list: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/render-entity-list-current-page. Based on it you should try the next code:

{% entityview id:params.view, page:params.page, pagesize:params.pagesize %}
...........

 

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.
ThareLyn
Helper I
Helper I

Hi,

Yes I always clear my cache whenever I did a change in portal management or codes.

And I tried to count the total record that it counts using entityview . total_records

ThareLyn_0-1623068947623.png


Yes I can use the 

the loopindex

But, but it will return the top 3 of the 10 record that is being returned. The issue is, I need to get all the record then filter it to records the is related to the current user of portal, then get the 3 most recent.

ThareLyn
Helper I
Helper I

I need to get all the record first because if I filter the 10 records that is being return, it doesn't show the other records that should be related on my portal user test account

So you need to obtain only records related to the current user? If yes and your user should see only them any way I would advice you to configure table permissions so the system will return only records your user has access to. Also if you don't need to use an entity list you can fetch the data directly via fetchxml and filter them immediately by the user in the request itself.

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

MPP IDEAS

Ideas

Discover ideas and concepts from users like you for how to use Power Pages and take your work to the next level.

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Users online (2,659)