cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RalphyC
Frequent Visitor

Hiding records in custom entityview/entitylist (Portal)

Hi all, 

I have a need to filter an entityview by an array. I'm rendering the items as follows:

 

{% for item in entityview.records %}
{% if MyArray contains {{item.attribute.name}} %}
... render some stuff...
{% endif %}
{% endfor %}
 
This all works fine. The problem is that the other items in the entityview.records list are still there, just not rendered. So in a pagesize of 10 where the 'if' condition catches 3 items, the page becomes only 3 items long, even if there are relevant results on later pages. 
 
What I really want to do is apply the 'if' condition not to entityview.records (which is only the current page) but entityview.[allrecords] but this doesn't seem to be an option. Failing that, an {% else %} condition that allows me to remove the records from the page would also work (but I can't see an option for that either).
 
Does anybody have any ideas?
 
Thanks
Ralph 
1 REPLY 1
OliverRodrigues
Super User II
Super User II

Hi, any Portal entity list refers to a view from in your CDS/Dataverse, have you considered applying the filter in that level?

If you are already using Liquid to render your entity list, are you leveraging anything from the Entity List itself? if not, have you consider retrieving the data via FetchXML?




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


 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (37,437)