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

Creating collection while retrieving only the MAX values

Hi, trying to create a collection from a PostgreSQL DB where I want to collect only the values with the MAX version, but I'm getting a delegation warning when using "max(version)" or when doing :

 

 

Max(Filter('im_e2e_instance.intervention_map',comp_id = projects.project_id), version)

 

 

I tried leaving it be, but it starts malfunctioning after a while and starts retrieving every version instead of only the MAX value of the version.

 

Not sure how to get around this.

1 ACCEPTED SOLUTION

Accepted Solutions

@Jargonaut

If possible, create a view in Sql using a query, limited to the fields you want to show and use that view in PowerApps instead of a collection. This will avoid all delegation issues. 

View solution in original post

3 REPLIES 3
Drrickryp
Super User
Super User

@Jargonaut(

With{{_items; Filter('im_e2e_instance.intervention_map',comp_id =projects.project_id)} , First(Sort(_items, version, Descending)).version

)

@Drrickryp  would it look something like this inside of my collection query?

 

ClearCollect(testthebogus,ShowColumns(With{_items; Filter('im_e2e_instance.intervention_map',comp_id =projects.project_id)} , First(Sort(_items, version, Descending)).version),"comp_id","date_created","intervention_question_id","order_position","survey_version","question_id"))

 

@Jargonaut

If possible, create a view in Sql using a query, limited to the fields you want to show and use that view in PowerApps instead of a collection. This will avoid all delegation issues. 

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 (3,433)