Hello,
I have an app that is used for document handling. The main goal of this question is to search through the current items in a gallery and if the title matches the title of the document in the attachments queue, display a warning message. Please view the picture for more clarity. Currently, I can only check against the first item in the gallery instead of every item.
I am sure this is simple, but I cant figure it out. Any advice would be greatly appreciated!
Solved! Go to Solution.
Actually, the picture was more confusing! Not sure what is what in there or what you have, but in general, your approach is to have a label that has the warning message in it and then, set the Visible property to:
CountRows(Filter(yourAttachmentsControl.Attachments, StartsWith(Name, yourLabel.Text)))>0
This will be true if the label text is in the attachments files names, and thus the warning will be visible.
I hope this is helpful for you.
@RandyHayes I actually figured it all out and all I can say is thank you for pointing me down the right direction! Final formula that works for me (Or statement not apart of original question)
Thanks again!
Actually, the picture was more confusing! Not sure what is what in there or what you have, but in general, your approach is to have a label that has the warning message in it and then, set the Visible property to:
CountRows(Filter(yourAttachmentsControl.Attachments, StartsWith(Name, yourLabel.Text)))>0
This will be true if the label text is in the attachments files names, and thus the warning will be visible.
I hope this is helpful for you.
Randy that was excellent! Even with the confusing picture. Thank you very much!
Yes, the picture had some lines and such, but not much labeling to explain. But I was able to read through the post you had to figure out what you needed.
Glad it helped!!!
@RandyHayes So I may have jumped the gun or just misunderstood. I need the warning to be visible when the 5 digit code of the new document to submit matches any of the five digit codes that have already been added to the folder. I just do not know what to replace "Label17.Text" with to search through all docs already submitted.
No worries!
So, then you are looking to provide a warning if the user has an attachment in the attachments control that matches something in the other 6 labels you have shown???
I am not sure what Label17 is in your picture and I had assumed that you had the Text formula already doing some of the logic to provide something relevant to the scenario you have.
So my question then would be - where are the other "already submitted documents" coming from?
So the bottom right hand corner is a gallery displaying the contents of a folder in a document library. This filter is applied to get the contents of the folder to display.
->
This is a label placed within the gallery to help display the files within ->
Hopefully this is more clear now
Okay...getting closer!
SO, (first - that Or(_galRefresh, !_galRefresh) part of your filter formula should go...it does nothing!) the DocumentType column - is it accurate to say that, if there is a DocumentType.Value of "PSF02" showing in that Gallery, then there IS a PSF02 document already, OR are you showing all document types in that gallery whether the document exists or not?
The or statement works off a timer to force the gallery to reload the items every 5 seconds simulating an auto refresh for the user.
All items in the gallery are items that have already been uploaded and are present in the doc library, so if PSF02 is showing in the gallery then it is already submitted. Here is an example where only one document has been submitted to that folder so far
So in this example only PSF02 has been submitted.
Yes, it is true that ANY part of a formula that changes will cause a re-evaluation of the formula - so, assuming your timer is refreshing the datasource - the formula will already re-evaluate and that "true" part (it will always be true) of your filter is not relevant.
As well, if the DataCardValue4.Text changes, then the formula again will re-evaluate.
So...it's just extra stuff in your app and an extra variable.
Okay...closer with each post!! Final question. Your attachment control is where the user is adding a document. You then want to have the label show if the document type already exists based on the first part of the file name (good so far?). My question is...what if they then add another document (i.e. multiple documents)? What is it you expect to do with that scenario?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
53 | |
41 | |
36 | |
30 |
User | Count |
---|---|
242 | |
82 | |
71 | |
69 | |
65 |