Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

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:
  • Cyril06 Profile Picture
    159 on at
    Re: One or multiple galleries that is the question...

    @RandyHayes Hello Randy yes you know I really tried to be careful with all the declarations and things like that .

    In fact I decided to simplify the formulas in fact I will create 4 differents screens/galleries for my 4 categories.

    Now in this format it works. I still have some issues but I can deviate.  I'm not totaly happy because I do not like to avoid a problem I like to resolve it but I have to go forward.

     

    Many thanks again to you for your time I learned many many many things with your help and I already use this things.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: One or multiple galleries that is the question...

    @Cyril06 

    So you are seeming to have more issues around forms than you are about your gallery formula.

    If you are planning to edit records, then you will need to reference the correct record from the Gallery.

    Your Item property on the form should reference the record that you want to edit.  Assuming that you are interested in editing (or viewing) the recent record, then you would need to set the Item property of the form to BrowseGallery1.Selected.ID as we have defined that in the formula to be the ID of the most recent record in your grouping.

  • Cyril06 Profile Picture
    159 on at
    Re: One or multiple galleries that is the question...

    @RandyHayes 

    I just made an other to be sur of what I describe to you.

    From the PARC_MSI  sharepointlist I click on the link "create a powerapp application"

    On the BrowseGallery1 Item property there was this

    SortByColumns(Filter([@PARC_MSI]; StartsWith(Title; TextSearchBox1.Text)); "Title"; If(SortDescending1; Descending; Ascending))

    All works fine

    After I put your process 

    DropColumns(AddColumns(AddColumns(GroupBy([@PARC_MSI];"Title";"records");"recent";First(SortByColumns(records;"Modified";Descending)));"STATUS_MACHINE";recent.STATUS_MACHINE;"SITE_MACHINE";recent.SITE_MACHINE;"Modified";recent.Modified;"ID";recent.ID);"records";"recent")

    I can observe different things:

    1 only the declared fields are not empty in the DetailScreen even if I have things written. To see them I need to declare them with the "xxxx";recent.xxxx; pattern.

    2 when I click on the modify icon I go to the EditScreen I make a change and when I click on the validate button the DetailScreen is from an other item (for my example I was on the MSI03 and it came back on the MSI02)

     

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: One or multiple galleries that is the question...

    @Cyril06 

    It sounds to me like you are changing around your datasources and the names and contents of it.  Please be aware that doing so will completely confuse PowerApps unless you know exactly what you are doing with the changes.  You need to certainly refresh the datasources in PowerApps, and if you are renaming lists, then you will mostly need to remove the old and add the new...of course this will then break all of the formulas that referenced the old and you will need to change the names in all of them.

  • Cyril06 Profile Picture
    159 on at
    Re: One or multiple galleries that is the question...

    @RandyHayes  Ok I think I'm starting to understand, is this in relation with the GroupBy() ?

    I just took it from scratch and just place the filtering process and I have the problem of not seeing the changes

     

    Maybe I can make an action with the Gallery OnSelect property to load differently "without" the grouping ... 🤔

  • Cyril06 Profile Picture
    159 on at
    Re: One or multiple galleries that is the question...

    @RandyHayes  Hello I just had time today to try the remove function you tell me. It doesn't work and I have a note "first argument of Removeif must be a collection" 

    So because I'm very doubtful about me I went on sharepoint, open a list named PARC_MSI (before it was HISTORIQUEMSI ...😁) and I asked Sharepoint to creat a PowerApp.

    I have 4 different sharepoint lists created on the same pattern so I created a button into a new screen with his oneselect property: 

     

     

    Set(CATEGORIECONSULTEE; PARC_MSI) 

     

     

    I changed every where the list name by may variable. OK

    I wrote your process to filter like I wanted to. OK

    Changed DataSource and Item properties like you said. OK

     

    I went to the editform I changed something I saw the change into SharepointList but nothing on the app screen until I went to my very first screen with the button and when I came back I saw the changes....

    Even with the refresh button (I also changed the CATEGORIECONSULTEE into it) do nothing.... 

     

    Do you have an idea of what's going on?

  • Cyril06 Profile Picture
    159 on at
    Re: One or multiple galleries that is the question...

    @RandyHayes  Really big thanks for all

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: One or multiple galleries that is the question...

    @Cyril06 

    If you're going to state the ID on the record you want to remove, then use RemoveIf and the following formula:

    RemoveIf(HISTORIQUEMSI; ID=GalleryMSI.Selected.ID)
  • Cyril06 Profile Picture
    159 on at
    Re: One or multiple galleries that is the question...

    It's been a month that I was looking for a solution !!!!!

     

    Finally I saw an other issue with the remove tool I tried

    Remove(HISTORIQUEMSI; GalleryMSI.Selected.ID)
    Remove(HISTORIQUEMSI; ID=GalleryMSI.Selected.ID)

    It's definitely not happy... any clue?

     

    Create it seems to be ok with the regular

    NewForm(EditForm1);;Navigate(EditScreen; ScreenTransition.None)

    do you think I need to be careful with something ?

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: One or multiple galleries that is the question...

    @Cyril06 

    For the Forms, you have to supply a DataSource (as mentioned) and the record that you want to edit/view.

    We could have derived from yourGallery.Selected (which is a record), however based on the formula we used in the Gallery Items property, the record you would have (the Selected) would not match a record from the datasource...and thus you will have an error.

    So, the *easiest* way to resolve that is just lookup the full record - which is what we did with the LookUp.  It will find that exact record based on the ID (which we exposed in the Gallery Items record signature) and that is what is used for the form.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,587 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard