Hi
I'm using a 'Get Mails V3' to retrive items from a mailbox. The filters I'm using will always ensure that only a single mail is returned.
When I have the results I'm sending an email and adding the single attachment I retrieved from 'Get Mails' action.
However PowerAutomate always wants to add 'Apply to each' when I add the attachment into my email which I'm trying to avoid to make my flow a bit cleaner. I know this is by design because it expects multiple attachments but my filters always ensure only one file will be returned
Is there anyway round this? I'd prefer to add the attachment using a variable or some expression
thanks
Paul
Hi @mahoneypat, Does this still work? I am attempting to send the attachments of a list item through an MS Approval, but it is saying property 0 does not exist for both expressions:
The list item where the attachment is held will only ever have one attachment and the trigger is "When an Item is Created". Any ideas? (The failed runs do return true for the has Attachments dynamic content)
Any ideas or help would be greatly appreciated!
Hi Pat
That works
If I had a few 'Get Mails V3' actions with different names how could I reference the name in the expression you sent me?
Paul
You can use this expression instead of the dynamic expression for your file content. It gets the file content for first record of the table of attachments.
triggerOutputs()?['body/attachments'][0]?['contentBytes']
You can use this to get the attachment name.
triggerOutputs()?['body/attachments'][0]?['name']
Regards,
Pat