Flow Designer - Email Attachments

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2021 05:17 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2021 05:26 AM
Hi,
you can use the size field on sys_attachment table to know the file size
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2021 05:31 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2021 05:42 AM
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
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2021 03:32 AM
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.
Thank you very much for your help.