Skip to content

Email Import with O365 to DOC²

Outlook Import to DOC² for certain sub-organizations#

With the following workflow you can upload email attachments from specific folders to a specific sub-organization of your DOC² organization. This can be useful if you want to import invoices from your Outlook inbox but only want them to be visible to a specific sub-organization.

1. The Interval node is used to trigger the workflow to run at regular intervals of time.
2. The Microsoft getFolders is an Outlook node that gets all the Folders in your Outlook Inbox.

  • Please follow the documentation to configure the Microsoft Login for Workflow.


3. The FunctionItem is a node where you can specify the folders intended for your sub-organizations. These must have the same name as the folders in your Outlook.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  checker = {
  '101_Polydocs':'',
  '102_Polydocs':''
    }

  mapping = {}

  item = $node["Microsoft getFolders"].json

  if (item.displayName in checker) {
    mapping[item.displayName]=item.id
  }

  return mapping;

4. The IF node checks if the folders entered in step 3 exist. If they exist and the name matches, the export continues. If the entered folder name does not exist, nothing happens.

5. The SplitInBatches node splits the list of folders down to single pieces to ensure that every Inbox gets checked after another.

6. The Get unread messages node searches for all unread messages.

7. The IF node will check if the Get unread message node found new messages and, if there are any, sends the information further.

8. The Get Attachments node will extract all the attachments from the emails. First, you have to select the Microsoft account configured in step 3.1

9. The Mark message as read node marks the emails that were checked in the steps above as read

10. The Download Attachments node downloads the attachments from the emails in a temporary directory as a binary file

11. The Switch node will send the document to the correct Upload Node depending on inbox.

12. The Upload Document node uploads the saved attachments to DOC². You just have to specify what inbox, in this case 101_Polydocs and to what sub-organization it is supposed to be uploaded.


13. Add the classification rules in DOC² so that the upload node knows where to upload the documents.

You can find this in the Settings under the menu item Classification and Extraction in the subitem Document Processing.


  • For the Pattern enter your Outlook folder name, in this example 101_Polydocs
  • For the type select E-Mail
  • For Sub Organization select the Sub-Organization where the documents should be uploaded.
  • You can choose any document type as the document type. Leave the field blank for each document type

Here is the complete workflow for you to download:

Download