In this time I have consumed many hours of video tutorials and user manual, and in this moment I building my second App.
This is my first post and I know that there is many people with more time of development, but I can't find my answer and I don't know how I can do it.
The point is that I have in my gallery, all records and I have added an icon to delete the record, but I only want to have this option only for the last record, and I don't know what condition I need write in "visible".
I tried with: "If(BrowseGallery1.Item.ID = Last('origin');true;false)"
Sorry for my English, I hope that you can understand me... hehehe
Solved! Go to Solution.
ID=First( Sort( Filter( [@'RECEPCIÓN DE MATERIALES']; StartsWith( Title; TextSearchBox1.Text ) ); ID ; Descending ) ).ID
in the Visible property of the icon. This formula will show the last item in your gallery and should take into account the filter. It is not necessarily the last item that is in your unfiltered list.
Are you trying to show an icon only in the final record of the gallery?
Put this code in the Visible property of the icon.
ThisItem.ID = Last(BrowseGallery1.AllItems).ID
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
@mdevaneythank you for your fast answer, but doesn't works.
The error now is something like "invalid argument type" (in English)
I found that instead of using Last(Browsegallery.AllItems), use the actual formula for the Items property of the gallery instead. In my example
nwind_ordernumber=First(Filter(Sort( Orders, 'Order Number', Descending ),TextInput2.Text in 'Order Number')).'Order Number'
Given that we can now see the OP has a sort control and a search box is there a way to write this which takes into account those elements.?
@DrrickrypIs exacly that I want to do it.
But I don't know how can reply your example in my form because I don't understand the function, but I thought also that I need some come condition over the option "Visible" of the trash icon.
My formula was just an example from a sample database. You would replace my formula with the Items property of your gallery but sort it by ID, Descending and use First(). I almost never use Last() or Max() in my apps because they are not delegatable and if the list exceeds the PowerApps limit, they will not give the correct value. First(Sort( Descending will always work no matter how big the data set is.
Check out new user group experience and if you are a leader please create your group
Check out how to claim yours today!
We are excited to announce that Demo Extravaganza for 2021 has started!
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks