1
votes

i am able to iterate through email attachments in azure logic app. i must have to compare attachment extension before further processing. i have been trying with content type parameter and passing values like '.xml' or 'xml' or 'application/xml'. none of them worked well.

what would be best practice to achieve this?

1
Are you passing these into something like an azure function when you mention the content type? Or do you just need to compare in the logic app if attachment is equal to something else (like other attachment)? - jeffhollan
i am just using in azure logic app. i have to check/compare attachment extension if it is possible? - Ravi Anand
if my reply is not enough clear please let me know. - Ravi Anand
@jeffhollan, thanks. if it is possible to compare attachment extension in azure function. i would love to go with azure function. i am fairly new with azure. - Ravi Anand
I am new to Azure too but if you want to check for XML the content type should be "text/xml", without the quotes. I know this is an old post but it's an alternative (assumed from the question he was looking for matching content type and XML). - Mark Davies

1 Answers

3
votes

If you want to check the filename extension of an attachment, create a condition using one of our workflow functions - http://aka.ms/logicappsdocs - like @endswith()

You can do this all in the designer as follows (I opened a condition and set "Attachment Name" to ends with xml

enter image description here

Also be sure you set your trigger to include the attachment data

enter image description here