Integromat

Getting Started

Setup

  1. Head to integromat.com 
  2. Login

eFileCabinet App

Click here  to see our app.

An integromat app is composed of several components. The important ones are:

Remote Procedure Calls (RPCs)

What are they?

How do I use them?




List Files

Communication

Each number in the following ordered list is referring to a block in code

  1. This block grabs the parent workspace id and initializes a counter so that the RPC will know where it currently is when it iterates in block 2. It also determines the last string in the path so that block 2 knows when it is done iterating
  2. This block iterates through each string in the path to get the nodeId by it's name
    • It knows it is done when the lastNamePath is equal to its currentName
    • This "condition": "{{if(parameters.path !== '/', true, false)}}" will prevent it from running when there is no path entered so as to save an API call
  3. This will show the user the next layer in the path
Notice
"response": {
     "iterate": "{{body}}",
     "output": {
          "label": "{{item.name}}",
          "value": "{{item.id}}",
          "file": "{{if(item.systemType === 7, true, false)}}"
      }
}


List Folders

Communication

Each number in the following ordered list is referring to a block in code

  1. This block grabs the parent workspace id and initializes a counter so that the RPC will know where it currently is when it iterates in block 2. It also determines the last string in the path so that block 2 knows when it is done iterating
  2. This block iterates through each string in the path to get the nodeId by it's name
    • It knows it is done when the lastNamePath is equal to its currentName
    • This "condition": "{{if(parameters.path !== '/', true, false)}}" will prevent it from running when there is no path entered so as to save an API call
  3. This will show the user the next layer in the path
Notice
"response": {
     "iterate": "{{filterFolders(body)}}",
     "output": {
          "label": "{{item.name}}",
          "value": "{{item.id}}"
      }
}

Modules

As of 10/06/2020, we have 4 modules built:

Download a file

Required Inputs Using Mappable Parameters

Interface

Note that this tab is only used when you need to specify to other modules what your output will be

Communication

Each number in the following ordered list is referring to a block in code

  1. This block grabs the parent workspace id and initializes a counter so that the module will know where it currently is when it iterates in block 2. It also determines the last string in the path so that block 2 knows when it is done iterating
  2. This block iterates through each string in the path to get the nodeId by it's name
    • It knows it is done when the lastNamePath is equal to its currentName
    • This "condition": "{{if(parameters.path !== '/', true, false)}}" will prevent it from running when there is no path entered so as to save an API call
  3. This block uses the pathId and the accessToken to makes a call to our API so that we can GET the file to download


Upload a file

Required Inputs Using Mappable Parameters

Communication

Each number in the following ordered list is referring to a block in code

  1. This block grabs the parent workspace id and initializes a counter so that the module will know where it currently is when it iterates in block 2. It also determines the last string in the path so that block 2 knows when it is done iterating
  2. This block iterates through each string in the path to get the nodeId by it's name
    • It knows it is done when the lastNamePath is equal to its currentName
    • This "condition": "{{if(parameters.path !== '/', true, false)}}" will prevent it from running when there is no path entered so as to save an API call
  3. This block processes the node that the user has input by selecting the last node. It then saves this id into a temp variable called "pathId"
  4. This block attempts to create the file in the requested parent node
    • If there is an error (as seen in the response body), then it will take the suggestedName in the Batch Object name for block 3
  5. Conditional block: This block will only run if the suggested name received in block 2 does not equal the file name parameter received
    • If this runs it will create the node with the suggested name
  6. Now that the node has been created it will begin the upload process. This block will FileUpload POST to retrieve the uploadIdentifier
  7. With the uploadIdentifier retrieved, this block will start the data upload
  8. Once the data has finished uploading, it will finalize by sending "complete": true


Create a node

Required Inputs Using Mappable Parameters

Communication

Each number in the following ordered list is referring to a block in code

  1. This block grabs the parent workspace id and initializes a counter so that the module will know where it currently is when it iterates in block 2. It also determines the last string in the path so that block 2 knows when it is done iterating
  2. This block iterates through each string in the path to get the nodeId by it's name
    • It knows it is done when the lastNamePath is equal to its currentName
    • This "condition": "{{if(parameters.path !== '/', true, false)}}" will prevent it from running when there is no path entered so as to save an API call
  3. This block uses the pathid found in block 2 to make a call to our API so that we can fetch the systemType. It then saves that in to temp variable "parentSystemType".
  4. This block starts by figuring the systemType of the new node, then it will POST the new node using the pathId, systemType, and name
    • If the parent is a workspace, it will create a cabinet
    • If the parent is a cabinet, it will create a drawer
    • If the parent is a drawer, it will create a folder
    • If the parent is a folder, it will create a folder


Rename a node

Required Inputs Using Mappable Parameters

Communication

Each number in the following ordered list is referring to a block in code

  1. This block grabs the parent workspace id and initializes a counter so that the module will know where it currently is when it iterates in block 2. It also determines the last string in the path so that block 2 knows when it is done iterating
  2. This block iterates through each string in the path to get the nodeId by it's name
    • It knows it is done when the lastNamePath is equal to its currentName
    • This "condition": "{{if(parameters.path !== '/', true, false)}}" will prevent it from running when there is no path entered so as to save an API call
  3. This block uses the pathId found in block 2 to update the node using PUT with the gathered name in the body