The Automation Requirement / Need
Whenever an email arrives, and the Subject contains the string “Hello World” then use Entersoft Connector to connect to the underlying back-end Entersoft Business Suite (ERP / CRM), Check whether there is a Customer that his/her invoice email address matches the FROM email address of the incoming email.
If no customer records or more than one is found matching the email address, Log an Entry into the back-end Entersoft Business Suite Audit Trail for this event.
Otherwise, reply to the email with data from the Customer’s Account as they are stored in the back-end system.
For this scenario, we will be using the “When a new email arrives (V3)” as a trigger with the condition that the Subject should contain the “Hello World” string that initiates the workflow (1).
Then we will involve the “Get a list of Entities by Type” operation from the Entersoft Connector (2).
Sign-in with the credentials of your Entersoft Cloud Subscription and Entersoft Business Suite User Credentials:
Through the listbox, I select the ESFICustomer entity to search for (3).
Then, we specify the Fields / Attributes of the ESFICustomer entity that I would to have returned by the service e.g., Code, Name, AlternativeCode, AlternativeName (4).
Then, we specify the filter / search params, as shown in (5). In our case we need the InvoiceEMailAddress of the Customer to match the email address “From” of the incoming email.
These steps are depicted in the following screenshot:
Now, depending on the Entersoft Connector’s “Get a list of Entities by Type” operation result, the flow will execute as explained below:
If the “Count “ (property of the operation’s response object) is NOT equal to 1 (i.e. either zero or more than 1 customers match the incoming email address) (6) then, I involved the Entersoft Connector’s “Log an event into Entersoft Business logging subsystem 2” operation (7) to log an entry that combines data from the incoming email as well as from the result of the “Get a list of Entities by Type” operation (8).
Then I terminate the flow with success (9).
In case that only one Customer matches the “From” email address of the incoming email, then I use the Send an email (v2) operation to send back a reply email with the Customer’s data.
The Subject of the email makes use of the Rows property of the operation’s “Get a list of Entities by Type” response, taking the zero element and getting the Name property (10).
The body of the email, contains other data (11) retrieved through the same mechanism.
This last operation, completes the flow.
Save the Flow.
Now you are ready to test it.
Use an email account to send an email to the email address that you have Signed-In in the Office 365 Connector when you specified the Trigger: “When a new email arrives”.
Make sure that the Subject contains the string “Hello World”, otherwise the trigger will not fire.
Wait for a few seconds and then click on the workflow:
To get all the details as shown in the screenshot below:
By clicking on a Run instance which is either Succeeded or Failed you will be directed to a page that has all the data for this Flow execution presented by a Flow Diagram, as they have been executed!