I am in the process of building a PowerApp that stores its data on a SharePoint OnLine list.
One of the fields is meant to be an Attachments Control that may carry one or more files. The record is validated by checking for data in relevant fields; I need to check whether or not the Attachments Control has any items attached to it.
I was unable to find out how to see if the Attachments Control has some property that would at least tell me if there are attachments associated with the control. The Microsoft documentation doesn't seem to describe any such feature, is there something I missed?
Solved! Go to Solution.
Hi @javierz ,
Could you please share a bit more about your scenario?
Do you want to check if there are some files attached to the Attachment control in your Edit form?
If you want to check if there are some files attached to the Attachment control in your Edit form, I agree with @bboardman thought almost.
Currently, within PowerApps, there is no direct property supported in Attachments control to tell us that if there are attachments associated with it. As an alternative solution, you could consider take a try to count the amount of the files attached within the Attachments control.
On your side, please take a try with the following formula:
Set the Text proeprty of the Label control to following:
"Attachments Amount: " & CountRows(DataCardValue13.Attachments) /* <-- DataCardValue13 represents the Attachments control in my Edit form */
On your side, you should take a try with the following formula:
if the result above formula returns is more than 0, it means that there are attachments attached within the Attachments control in your Edit form.
I wanted to disable Submit button if no attachment is attached. used the below on DisplayMode of the button. AttachmentsNF is my attachment card.
If( CountRows(AttachmentsNF.Attachments)>0 , DisplayMode.Edit, DisplayMode.Disabled )
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.