Hi, I'm a newcomer to PowerApps and I'm currently working on a project. My managers have requested a feature to check if attachments are correctly uploaded by users, based on the screenshot below. How can I configure the submit button to validate the attachment data card, ensuring no attachment is missing based on the Attachment Category on the left side of my form?
In addition to the code shown in my screenshot, I have also tried the following code, but it is not working.
// Function to check if all attachments have valid tags
/*If(
// Check if the number of attachments without valid tags is 0
CountIf(
DataCardValue77.Attachments,
!(First(Split(DisplayName, "-")).Result in ["BIR", "DTI", "AFS", "Non Vat"])
) = 0 && CountRows(DataCardValue77.Attachments) > 0, // Ensure there is at least one attachment
SubmitForm(FrmCreditLineRequest), // Submit the form if all attachments have valid tags
Notify("Please attach files with valid tags (BIR, DTI, AFS, Non Vat).", NotificationType.Error) // Notify if there are invalid tags
)*/
/*If(CountIf
(ColAttachments, !
(First
(Split(DisplayName, "-")
).Value in ColAttachTags = ["BIR", "DTI", "AFS", "Non Vat"]
)
)=0, SubmitForm(FrmCreditLineRequest),
Notify("Please attach files with valid tags (BIR, DTI, AFS, Non Vat).")
)*/
