Step 1: Create the Flow component
The first step is to create a Flow component. This Flow component will be part of the Flow twice. The user enters configuration values in the Flow component through Field Mapping.
To go to the Flow component, click โFlow componentโ under the โBackground processesโ menu on the left side panel.

To create a new Flow component, click [+ Flow component].

The โDetailsโ tab is selected by default.
To define the Flow component, label it as โActivityEmailSenderโ.
To elaborate on the purpose of this Flow component, optionally enter a description.
To store information/logs regarding the execution of the Flow component and associated events, create a โFlow Progression Entityโ labeled as "UserName_flowApp_progressionโ by clicking the [+] button.

To enable execution of multiple requests, disable โSkip execution while in progressโ by clicking the toggle button.


To define the Mapped Fields, expand the โField Mappingโ section by clicking on the arrow. Mapped Fields are input fields for this Flow component. (When the Flow component is placed in a Flow, the user can assign values to these fields in the form of constant text or from relevant sources before executing the Flow.) To add a new field, click [+ Field]. Add nine (9) mapped fields.

To set up the Mapped Fields, define the fields as follows:
Mapped Field: โCustomerIDโ, Data Type: โstringโ. This mapped field will contain Customer ID information.
Mapped Field: โFromโ, Data Type: โstringโ. This mapped field will contain the text displaying which person or team sent the email.
Mapped Field: โSubjectโ, Data Type: โstringโ. This mapped field will contain the contents of the email subject.
Mapped Field: โEmailBodyโ, Data Type: โstringโ. This mapped field will contain the contents of the email subject.
Mapped Field: โActivityTypeโ, Data Type: โstringโ. This mapped field will contain the value of the type of activity being recorded for the customer.
Mapped Field: โAssignedToโ, Data Type: โstringโ. This mapped field will contain the information about who the task was assigned to.
Mapped Field: โPriorityโ, Data Type: โnumericalโ. This mapped field will contain the priority of the activity in terms of a numerical value.
Mapped Field: โDescriptionโ, Data Type: โstringโ. This mapped field will contain the description of the activity.
Mapped Field: โEmailTypeโ, Data Type: โstringโ. This mapped field will contain the description of the type of email e.g. Marketing email.
After all fields are defined, the Field Mapping section will be as per the image below.

To expand the โEventsโ section, click on the โEventsโ arrow. In this section, the users define the events that may be triggered during the execution of the Flow component.

When a Flow component is created, its four (4) predefined Events are displayed in this section:
โSuccessโ
โErrorโ
โWasDisabledโ
โAlreadyRunningโ

To create a new โEventโ, click the [+ Event] button.

The Event box displays. It is enabled by default.
To define the Event:
Enter the Event name to be displayed.
Enter the Event name for the platform.

To associate more Events with this Flow component, create the following additional events.
โSentโ: This Event is triggered when the email is sent.
โOpenedโ: This Event is triggered when the email is opened.
โBouncedโ: This Event is triggered if the email bounces back i.e. it is not delivered.
โLinkClickedโ: This Event is triggered when the link in the email is clicked. If a link is provided in the email and the user clicks it, the Event will trigger the Flow component connected to it in the Flow.

To configure the icon for this Flow component, click the โLangstackโ icon on the right-hand side.
A dialog box displays. To select the image to load as the Flow component icon, click on the โLangstackโ icon or โUpload iconโ button. In this exercise, the Mail icon is selected. (user can choose any image). To save the image, click the [Save] button.
The new icon displays.
To view the predefined variables for the Flow component, go to the โVariablesโ tab. Two (2) variables are already defined to store the values entered by the user in defining the Flow component Mapped Fields.
Variable Name: โSourceโ, Data Type: โJXPFlowAppActivityโ. This variable contains a number of elements relevant to the Flow component activity in a Flow that hold a certain value.
Variable Name: โMappedFieldsโ, Data Type: โjsonโ. Mapped fields contain the values in Json format.

To create a new โTarget Entityโ, go to the โTarget Entitiesโ tab and click the [+ Target entity] button.

To define the target entity, select โUserName_Acc_Activitiesโ from the drop-down menu. The created record with this Flow component will be stored in this entity.

To define a sequence of Actions to create an entity record in the target entity, go to the โCodeโ tab. To create a new โAction boxโ, click the [+ Action box] button.

Label the Action box as โcreate anniversary email recordโ. In this โAction boxโ, the necessary actions will be added and configured to create an anniversary email record for the customer.

To define the variables to be used in the โAction boxโ, expand the โAction boxโ and go to the โVariablesโ tab. To create a new variable to store values, click the [+ Variable] button.

To load the records from the entity โUserName_Acc_customersโ into a variable, define the variable as follows:
Variable Name: โCustomerโ
Data Type: โUserName_Acc_customersโ

To add Actions, go to the โCodeโ tab in the Action box to add Actions.
To load the entity record into the variable โCustomerโ, add and define this first Action as follows:
Select Action as โLoad Entity recordโ.
From the drop down menu, select the variable โCustomerโ. The entity record will be loaded into the variable โCustomerโ.
To configure the criteria settings, click the โCriteria settingsโ icon.

To configure the settings for how the records of the entity will be loaded into the variable, in the โLoad Entity recordโ Action criteria settings, define the following fields:
Select โOrder byโ as โCustomer_IDโ. The records will be displayed by ordering the โCustomer_IDโ field.
Sort in โAscendingโ order. The records will be loaded in ascending order.
Create a new โMatch keyโ by clicking the [+ Match key] button.

Define the match key as follows:
Select the field โCustomer_IDโ from the drop down menu. This match key maps the โCustomer_IDโ field in the entity to the field โCustomerIDโ in the โMapped Fieldsโ.
Select the source as Variables>MappedFields>CustomerID>toGUID(). It is displayed as โMappedFields.CustomerID.toGUID()โ. The value of the โCustomerIDโ provided in the mapped field of the Flow component by the user will be aligned with the โCustomer_IDโ field (after conversion from Json to GUID) in the entity.
Click the [Save] button.

To check if the record is loaded, add another Action and define it as follows:
Select Action as โCondition actionโ.
Enter the description as โcheck if the record is loadedโ.

To define the variables to be used in the โCondition actionโ, expand the โCondition actionโ and go to the โVariablesโ tab. Create two (2) variables.

To convert the record in the Customer variable into Json before triggering the Flow component activity, define the first variable as follows:
Variable Name: โJSโ
Data Type: โJsonโ

To update the values of the record fields to be loaded into the entity โUserName_Acc_Activitiesโ, define the second variable as follows:
Variable Name: โCustomerActivityโ
Data Type: โUserName_Acc_Activitiesโ

To define the criteria for this action, go to the โCriteriaโ tab. To verify if the record is loaded, add and define a Criteria bar as follows:
Select Variables>Customer. It is displayed as โCustomerโ.
Select the Operator as โIs Setโ.

To define the actions in case the criteria returns a True value, go to the Code tab>On True section.

To define a sequence of actions to create an email activity record, define a Group action as follows:
Select Action as โGroup actionโ. The actions defined within a Group action are treated as a group. When the Group action is changed in the position or copied, the changes are applied to all the actions defined within the group.
Add the description as โcreate an email activityโ. This action contains a sequence of actions to create an email activity and update it in the โUserName_Acc_Activitiesโ entity.

To create a new Action in the Group action, click the (+) button in the Group action. To update the values of the new record, add nine (9) Actions in the Group action by clicking the (+) button.
To update the โActivity_AssignedToโ field of the record with the value from the mapped field โAssignedToโ (defined in the Details>Field Mapping section), define the first Action as follows:
Select Action as โUpdate Variableโ.
Select Target variable as CustomerActivity>Activity_AssignedTo. It is displayed as โCustomerActivity.Activity_AssignedToโ.
Select Value as Variables>MappedFields>AssignedTo. It is displayed as โMappedFields.AssignedToโ.

To update the โActivity_CreatedByโ field of the record with the text โActivityEmailSender Flow componentโ, define the second Action as follows:
Select Action as โUpdate Variableโ.
Select Target variable as CustomerActivity>Activity_CreatedBy. It is displayed as โCustomerActivity.Activity_CreatedByโ.
Type Value as โActivityEmailSender Flow componentโ and press Enter. It will display in a blue bubble.

To update the โActivity_DateTimeโ field of the record with the current date, define the third Action as follows:
Select Action as โUpdate Variableโ.
Select Target variable as CustomerActivity>Activity_DateTime. It is displayed as โCustomerActivity.DateTimeโ.
Select Value as Functions>DateTime>Now(). It is displayed as โDateTime.Now()โ.

To update the โActivity_Descriptionโ field of the record with the value from the mapped field โDescriptionโ (defined in the Details>Field Mapping section), define the fourth Action as follows. (The value in this field is entered as a string by the user in the Flow component.)
Select Action as โUpdate Variableโ.
Select Target variable as CustomerActivity>Activity_Description. It is displayed as โCustomerActivity.Activity_Descriptionโ.
Select Value as Variables>MappedFields>Description. It is displayed as โMappedFields.Descriptionโ.

To update the โActivity_Priorityโ field of the record with the value from the mapped field โPriorityโ (defined in the Details>Field Mapping section), define the fifth Action as follows.
Select Action as โUpdate Variableโ.
Select Target variable as CustomerActivity>Activity_Priority. It is displayed as โCustomerActivity.Activity_Priorityโ.
Select Value as variables>MappedFields>Priority>toInteger(). It is displayed as โMappedFields.Priority.toInteger()โ. (The value is entered as a string by the user and converted to Integer before creating the record.)

To update the โActivity_Typeโ field of the record with the value from the mapped field โEmailTypeโ (defined in the Details>Field Mapping section), define the sixth Action as follows. The value is entered as a string by the user in the Flow component.
Select Action as โUpdate Variableโ.
Select Target variable as CustomerActivity>Activity_Type. It is displayed as โCustomerActivity.Activity_Typeโ.
Select Value as Variables>MappedFields>EmailType. It is displayed as โMappedFields.EmailTypeโ.

To update the โActivity_Statusโ field with details including the customer email and the type of email sent, define the seventh Action as follows:
Select Action as โUpdate Variableโ.
Select Target variable as CustomerActivity>Activity_Status. It is displayed as โCustomerActivity.Activity_Statusโ.
In the Value, define two (2) values that together display as : โEmail sent to the customer emailโ โCustomer.Emailโ. For example, the email sent to customer email address โ[email protected]โ, it will be displayed in the entity as โEmail sent to the customer email [email protected]โ.โ
First type constant text as โEmail sent to the customer email โ and press Enter. It is displayed in a blue bubble.
In the same field, select Variables>Customer>Email. It is displayed as โCustomer.Emailโ.

To update the โCustomer_IDโ field of the record with the value from the mapped field โCustomerIDโ (defined in the Details>Field Mapping section), define the eighth Action as follows. (The value is entered as a string by the user in the Flow component and converted to GUID before creating the record in the entity.)
Select Action as โUpdate Variableโ.
Select Target variable as CustomerActivity>Customer_ID. It is displayed as โCustomerActivity.Customer_IDโ.
Select Value as Variables>MappedFields>CustomerID>toGUID(). It is displayed as โMappedFields.CustomerID>toGUID()โ. The value is entered as a string by the user in the Flow component and converted to GUID before creating the record in the entity.

To create the record into the โUserName_Acc_Activitiesโ entity and get the โJXPResponseโ when the entity record is created, define the last Action in the Group action as follows:
Select Action as โCreate Entity recordโ.
Click [+] and add a variable named โResultโ. This variable is of JXPResponse data type and is displayed in the โVariablesโ tab of the โAction boxโ. This variable will contain the response to display when the created record is loaded into the target entity.
Select Value as โCustomerActivityโ. This variable contains the values of the entity fields updated in the โGroup actionโ.

To update the customer entity record into a json variable before triggering the Flow component Event, add another Action by clicking the (+) button in the โAction boxโ after the โGroup actionโ (within the โOn Trueโ section).
To update the target variable โJSโ with details in the Customer variable,define the Action as follows:
Select Action as โUpdate Variableโ.
Select Target variable as โJSโ.
Select Value as Variables>Customer>toJson(). It is displayed as โCustomer.toJson()โ.

To trigger the Flow component event with an event Sent, add the last Action as follows:
Select Action as โTrigger Flow component eventโ.
Select JXPFlowAppActivity as โSourceโ.
Enter the Event name as โSentโ.
Select Details json as โJSโ (Variables>JS).

To save the Flow component, click the [Save] button.

To publish the Flow component, click the [Publish] button.

To enable the Flow component, in the Details tab click the toggle button to set it as โEnabledโ.

Last updated
