Demo - sending criteria based alerts to contacts from an excel workbook

Avatar

By Andrei Ciucean

updated about 1 month ago

Scenario: We will create a process flow that notifies decisional factors, if the products contained in an excel sheet are within budget range.

This will be a basic scenario where PROCESIO can help you with sending criteria based alerts to management, notifying them on actions that need to be taken.

This particular flow has the aim of sending an SMS alert as well as an e-mail to decisional factors, for each item priced above or equal to 100 $ (these items are considered to be above budget). For items priced below 100$ (items within budge range), only an e-mail alert will be sent to decisional factors. In this case, the email will state that the item is within the budget range, and therefore order placement can take place.

Before you get started, you will need the following items in order to complete the suggested process:

  • a configuration to an email server that will be used to send the email. (see here)
  • a configuration to a REST API of an web-to-sms service. (see here) 
    • the above require creation of 2 connection configurations in the Credentials Manager.
  • Excel/ CSV file containing tabular data

Let's build this process! The process flow created will look like this: 


Step 1: Drag and drop "Get File Data" into the canvas connect it to the "Start" Button.

Drag and drop a "For Each and connect it to the "Get File Data". 

  • Within the "For Each" border, drag and drop a "Decisional" action and connect it to the "Start" within the "For Each"
  • Within the "For Each" border, drag and drop a "Call Api Action" action connect it to the "Decisional".
    • Within the "For Each" border, drag and drop a "Send Email" action and connect it to the "Call Api Action".
      • Within the "For Each" border, drag and drop a "Join" action and connect it to the "Send Email"
    • Within the "For Each" border, drag and drop a second "Send Email" and connected to the "Decisional" and to the "Join" action.
  • Connect the "For Each" border to the "Stop" action.

Step 2: Configure the "Get File Data" according to documentation. For configuring this step video available here.

Step 3: Configure the "For Each"

  • "In List", we will use the variable/ data model, defined at Step 2.

  • Set "Action timeout" to 200 milliseconds. In order to avoid an infinite loop, we want the "For Each" action to stop after 200 second of running (can be set in accordance to needs). 
  • In the "For Each" output tab, you will mention the name of the item in the list used for each iteration. Refers to the line item in your excel file.




Step 4: Configure "Decisional" action within the "For Each" border. Each case of the "Decisional" needs to be configured.

  • For this demo, you will have to configure two cases:
    • greater than or equal to 100$
    • less than 100$
  • Case 1: we will use "CustomerCsvLine.price", defined in the "For Each" output (mentioned in Step 3).
    • We will set the "customercsvline.price" to be greater than or equal to 100.
      • Additionally at "Target", Go To, we will set "Call Api Action". This means that if the condition is met, the "Decisional" will follow the "Call Api Action" branch.


  • Case 2: we will use "CustomerCsvLine.price", defined in the "For Each" output (mentioned in Step 3).
    • We will set the "customercsvline.price" to be less than 100.
      • Additionally at "Target", Go To, we will set "Send Email (less 100)". This means that if the condition is met, the "Decisional" will follow the "Send Email (less 100)" branch.



Step 5: Configure "Call Api Action" & "Send Email (greater 100)" actions

  • As mentioned at the beginning of this article, connections for "Call Api Action" as well as "Send Email" have to be created within "Credentials Manager". See in this article how to set up connections in Credentials Manager for  "Call Api Action" as well as "Send Email".
  • Once connections have been created in Credentials Manager:
    • "Call API Action":
      • Select Api configuration (previously configured in Credentials Manager) and proceed to configure request.
      • The request needs to be configured ("Configure Request" card) in accordance with the API provider documentation. In our case SMSO API documentation.
        • In accordance with SMSO API documentation, we will use the following Query Params:
          • To: CustomerCsvLine.phonenumber (leveraging the phone number contained in the excel file)
          • body: Can be customised according to needs
          • Sender: 4 (in accordance to SMSO API documentation)
    • "Send Email (greater 100)":
      • Select SMTP Server (previously configured in Credentials Manager) and proceed to "Send Email" configuration.
      • Proceed by clicking on "Send Email" card and configure it.
      • From: Type a desired display name. (The e-mail addressed configured in the Credentials Manager will be leveraged)
      • To: CustomerCsvLine.email (leveraging the e-mail address contained in the excel file)
      • Body: Custom according to needs. 
To open the variables selector in Body and add process variables to your message: press Insert key (for Windows) or Alt+Tab (for MacOS)

Step 5:  Configure "Send Email (less 100)" 

  • Select SMTP Server (previously configured in Credentials Manager) and proceed to Send Email configuration.
  • Proceed by clicking on "Send Email" card and configure it.



  • From: Type a desired display name.
  • To: CustomerCsvLine.email (leveraging the e-mail address contained in the excel file)
  • Body: Custom according to needs. Variables in the body of the e-mail can be inserted by hitting "Insert" button.

Step 6: Save & Validate Process

Step 7: Run Process

 

Did this answer your question?