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 )
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.