Hello,
I am experiencing an issue with PowerApps - Attachment Control.
I have created an app using a SharePoint list and I used a form control. My requirement is to allow only to upload .pdf and .xlsx file types in the attachment control.
I used below functions in "OnAddFile" property of attachment control.
If(
Not(
EndsWith(
Last(Self.Attachments).Name,
".pdf"
)
) And Not(
EndsWith(
Last(Self.Attachments).Name,
".xlsx"
)
),
Notify(
"Only .pdf and .xlsx files are allowed",
NotificationType.Error
);
RemoveIf(Self.Attachments, Name = Last(Self.Attachments).Name);
)
In this way, attachment adds to the form control, even if it is not an acceptable file type. But when trying to upload another attachment, previously uploaded incorrect file removes.
I need to stop adding that incorrect attachment to the form control. I used Reset() function as well. But it resets the entire
attachment control. I need to remove only the unacceptable attachment.
Please can someone help me with this?