It is only returns 10 records even I have like 30+ records
Mycode is:
Does anyone knows the problem in here? Please help. Thanks.
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
Power Apps Portals Super User
Well to be honest. I put a 3 on page size
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.
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
Power Apps Portals Super User
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 %}
...........
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
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.
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.