web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / One or multiple galler...
Power Apps
Unanswered

One or multiple galleries that is the question...

(0) ShareShare
ReportReport
Posted on by 159

Hi with my bad english an exemple will be faster and limpid so:

From this sharepoint list: (french date format too )

 

TitleColorModified
PC01Red20/01/2020
PC01Blue22/01/2020
PC02Green26/01/2020
PC03Yellow25/01/2020
PC03Red28/01/2020
PC04Green12/01/2020
PC04Blue24/01/2020
PC04Red28/01/2020

 

I want a screen showing this result

 

TitleColorModified
PC01Blue22/01/2020
PC02Green26/01/2020
PC03Red28/01/2020
PC04Red28/01/2020

 

The last modified entry of each PC

I did it with 4 galleries on the same screen showing the Last() and navigating into 4 DetailForms and 4EditForms it's not sexy (one for each PC01, PC02...)

Is that possible to doit wih only One Gallery, One DetailForm and EditForm ? 

Categories:
I have the same question (0)
  • rsaikrishna Profile Picture
    3,703 on at

    @Cyril06 

     

    On Visible property of the screen: 

    ClearCollect(colPCs, First(SortByColumns(Filter(PCList,Title="PC01"),"Modified",Descending)));

    Collect(colPCs, First(SortByColumns(Filter(PCList,Title="PC02"),"Modified",Descending)));

    Collect(colPCs, First(SortByColumns(Filter(PCList,Title="PC03"),"Modified",Descending)));

    Collect(colPCs, First(SortByColumns(Filter(PCList,Title="PC04"),"Modified",Descending)))

     

    Gallery's Items property, set the value to colPCs.

     

    Give a try and let me know if you have any questions.

     

    Regards

    Krishna Rachakonda

    If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

     

     

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Cyril06 

    Please consider the following formula on a Gallery Items property:

    DropColumns(
     AddColumns(
     AddColumns(
     GroupBy(
     Table(
     {Title:"PC01", Color:"Red", Modified:DateValue("1/20/20")},
     {Title:"PC01", Color:"Blue", Modified:DateValue("1/22/20")},
     {Title:"PC02", Color:"Green", Modified:DateValue("1/26/20")},
     {Title:"PC03", Color:"Yellow", Modified:DateValue("1/25/20")},
     {Title:"PC03", Color:"Red", Modified:DateValue("1/28/20")},
     {Title:"PC04", Color:"Green", Modified:DateValue("1/12/20")},
     {Title:"PC04", Color:"Blue", Modified:DateValue("1/24/20")},
     {Title:"PC04", Color:"Red", Modified:DateValue("1/28/20")}
     ),
     "Title", "records"
     ),
     "recent", First(SortByColumns(records, "Modified", Descending))
     ),
     "Color", recent.Color,
     "Modified", recent.Modified
     ),
     "records"
    )

     

    Three labels in the Gallery -  ThisItem.Title  another with ThisItem.Color  and another with ThisItem.Modified

     

    Will give you the following:

    RandyHayes_0-1602519941957.png

    I hope this is helpful for you.

  • Cyril06 Profile Picture
    159 on at

    Hi Randy and Thank you.

    Do you think it's possible to replace the Table(...) by the sahrepoint list?

    I hav 12 columns and 10 categories of itemhere was only PC...

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Cyril06 

    Yes, you can certainly replace the table.  I used that for the example only so that you could see a complete formula-to-results scenario.

    You can substitute as needed:

    DropColumns(
     AddColumns(
     AddColumns(
     GroupBy(
     yourDataSource,
     "Title", "records"
     ),
     "recent", First(SortByColumns(records, "Modified", Descending))
     ),
     "Color", recent.Color,
     "Modified", recent.Modified
     ),
     "records"
    )

    Just replace the "yourDataSource" in the formula above to be your SharePoint list.

  • Cyril06 Profile Picture
    159 on at

    Hi Rsaikrishna and thank you.

    If I understood well PCList is my SharepointList name and when I click on the gallery on the proporty of Item I write colPCs ?

  • Cyril06 Profile Picture
    159 on at

    Not working..;  I think I missed something what is "records","recent" ? I understood that Title and Color was my columns label but those two ?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Cyril06 

    Records is part of the GroupBy function.  It is just an internal name to name the resultant set of records that are grouped.  Please refer to the GroupBy function for more details.

    Recent is again just a name that I used internal to the formula in order to get the most recent item.  It is only for the formula calculation and an added column.

    None of those have an issue.

    You say not working - what is not working?  Can you provide either an error message, a screenshot or something to guide you to the next step?

  • rsaikrishna Profile Picture
    3,703 on at

    Thats correct @Cyril06 

     

     PCList is your SharepointList name .

     

    Regards

    Krishna Rachakonda

     

  • Cyril06 Profile Picture
    159 on at

    It works fine. I have to check with more samples.

    An other question now on the Gallery OnSelect what should I put to Edit or Detail the Entry I clicked on ?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Cyril06 

    Can you reference what works fine?  The suggestion by @rsaikrishna or the solution I provided?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard