cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

filter galery from - to

Hi Community, 

 

I have one Gallery that is showing the information from one Entity called "Personas"

On the other hand i have one variable called FROMID with the last id of this entity

I want to put in the items formula something similar to this

 

Show the las 100 records from Persona starting from the variable FROMID.

 

In addition i will create one "pagination" where the icon next will update the variable FROMID with the last id of the gallery.

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Anonymous ,

 

Do you want to divide the entity records to 100 per page in the gallery, and the first page to show the first 100 records?

If you do, please set the gallery screen’s OnVisible to:

 

Set(FROMID,Value(Last(FirstN(Sort(Personas,Value(ID),Ascending),100)).ID))

 

Then set the gallery’s Items:

 

Sort(Filter(Personas,Value(ID)<= Value( FROMID), Value(ID)> (Value(FROMID)-100)),Value(ID))

 

At last, to update the variable, set the OnSelect of the Next Icon to:

 

Set(FROMID,Value(Last(Sort(Gallery1.AllItems,Value(ID))).ID)+100)

 

I've made a test:

dividedgallery.gif

Is it like what you want?

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it more.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2

Hi @Anonymous 

 

Can you try to update the expressions to:

Filter(Personas, StartsWith(ID, FROMID)

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

v-jefferni
Community Support
Community Support

Hi @Anonymous ,

 

Do you want to divide the entity records to 100 per page in the gallery, and the first page to show the first 100 records?

If you do, please set the gallery screen’s OnVisible to:

 

Set(FROMID,Value(Last(FirstN(Sort(Personas,Value(ID),Ascending),100)).ID))

 

Then set the gallery’s Items:

 

Sort(Filter(Personas,Value(ID)<= Value( FROMID), Value(ID)> (Value(FROMID)-100)),Value(ID))

 

At last, to update the variable, set the OnSelect of the Next Icon to:

 

Set(FROMID,Value(Last(Sort(Gallery1.AllItems,Value(ID))).ID)+100)

 

I've made a test:

dividedgallery.gif

Is it like what you want?

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it more.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,219)