Hi with my bad english an exemple will be faster and limpid so:
From this sharepoint list: (french date format too )
Title | Color | Modified |
PC01 | Red | 20/01/2020 |
PC01 | Blue | 22/01/2020 |
PC02 | Green | 26/01/2020 |
PC03 | Yellow | 25/01/2020 |
PC03 | Red | 28/01/2020 |
PC04 | Green | 12/01/2020 |
PC04 | Blue | 24/01/2020 |
PC04 | Red | 28/01/2020 |
I want a screen showing this result
Title | Color | Modified |
PC01 | Blue | 22/01/2020 |
PC02 | Green | 26/01/2020 |
PC03 | Red | 28/01/2020 |
PC04 | Red | 28/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 ?
@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.
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.
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)
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.
@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 ... 🤔
@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?
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)
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 ?
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.
WarrenBelz
146,587
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional