Flow Designer - Email Attachments

Community Alums
Not applicable

Hi Team,

We have an inbound action using Flow Designer which creates incident from emails received from a particular account say AccountABC. We want our flow to create a ticket only if the email attachment is at least 50KB and if no attachment then it shouldn't create a ticket.

Current flow is as below:

Inbound Action
Create Record/Ticket
Lookup Email Attachments
For Each Item in Email Attachment Records
    If Content Disposition is Attachment
         Lookup Attachment Record
         Copy Attachment

Now we need to create a ticket after checking the attachments in the email. 

Inbound Action
Lookup Email Attachments
For Each Item in Email Attachment Records
    If Content Disposition is Attachment
        Lookup Attachment Record

Create Record/Ticket should be used before Copy Attachment and we can not use this inside the for each because it will create multiple records if there are multiple attachments in the same email.

Please assist us with this modifications.

Thank you.

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use the size field on sys_attachment table to know the file size

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Community Alums
Not applicable

Thanks for the response.

That we are using in If condition

If Content Disposition is Attachment and attachment size bytes greater than 5000

But query is we can not use Create Record/Ticket inside the for each because it will create multiple records if there are multiple attachments in the same email.

Thank you.

 

Hi,

then you can use Global flow variable to check if the size is more or not

Then use If action to check value of this flow variable and based on that create ticket

Flow variables

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Community Alums
Not applicable

Hi Ankur,

As per your inputs, I have created flow variables but it has limited data types. I can not add create record inside for each loop as it creates record for every attachment in the same email. But not sure about setting up value for flow variable inside for each loop. Below is my flow.

find_real_file.png

Thank you very much for your help.