Hi, my app sends an email when everything is completed, and I would like to include the first photo from my 'photoattachments' collection as an attachment to the SendEmailV2 command. It is working fine with a code I created, but when the user don't take any photo, it gives an error. I tried to make an exception as below:
(...) If(CountRows(photoattachments) > 0 , {Cc:First(DRACollection).ProjectManagerEmail, Attachments: {Name: "RAMS - " & First(photoattachments).Name, ContentBytes: First(photoattachments).att,'@odata.type':""}},{Cc:First(DRACollection).ProjectManagerEmail})
But it gives strange error messages, like e.map is not a function.
Could you please advise me the best solution to just avoid adding attachment to the email when the 'photoattachments' collection is empty? Thank you