Retrieving Contact Information with the Flow Designer

Last Updated: 07/19/2016 Introduced in Verision: 2.0

 

The Contact Info Entity is a folder entity which collects addresses, phone numbers, email addresses and other contact details into a single entity. These contact details can be retrieved in a flow by using the Contact Info Owner Id as input for the appropriate steps: such as those under the Phone Service or Email Address Service.

Example

In our example flow, we will send an email to one of a customer’s email addresses. If the customer has no email addresses, we will see a form telling us of this.

result

 

We will first navigate to the actions folder of our Customer folder extension type at: System > Common Data Elements > Folder Behavior Actions > UserType.CustomerFolderBehavior. To create our action, we will click the Create Flow button.

createFlow

 

In the resulting New Flow pop-up, we will call our action “Send Email to Customer” and click OK to open it in the Flow Designer.

nameFlow

 

First, we will place the Get Customer component in our flow, so that we can have at hand all of the properties of our Customer folder. It can be found in the Flow Designer start-up window, under the category Integrations >All Integrations > Folder Extension Data Structures > Customer.

 

 flowStarts

For the Get Customer component, we will map FolderId to Id. We will also rename the output Result to “Customer”.

mappingForGetCust

 

Before retrieving the Customer’s email addresses, we must first get the ID of the Contact Info Owner (the Contact Info Entity) in which the email addresses are collected. We will find the Get Or Create Contact Info Owner Id For Folder component in the Toolbox tab, under the category Integration > Internal Services > ContactInfoService.

dragGetContactInfo

 

In the Mapping Editor, we will map FolderId to folderID and set createIfDoesNotExist to True. We will also rename the output to “ContactInfoOwnerId”.

mappingToContactInfo

 

Next, we will get the email addresses belonging to the Contact Info Owner. We will find the Get All Email For Owner component in the Toolbox tab, under the category Integration > Internal Services > EmailAddressService.

dragGetAllEmail

 

In the Mapping Editor, we will map ContactInfoOwnerId to ownerId, and rename its output to “AllEmails”.

mappingToGetEmails

 

Next we will check whether any email addresses were returned by the Get All Email For Owner component. We will find the List Is Null Or Empty component in the Toolbox tab, under the category Data > List.

dragListEmpty

 

We will map AllEmails to values.

mappingToListIsEmpty

 

If the Customer has emails, we would like to display a form with which the user can send an email. For this purpose, we have pre-designed a form called Send Email to Customer Form. We will find it in the Toolbox tab, under the category Forms [Interaction] > [Root Folder] > Designer Entities.

dragForm

 

In the Mapping Editor, we will map AllEmails.All Address to EmailAddresses.

mappingToForm

 

 

Next, we will send the actual email. We will find the Send Email component in the Toolbox tab, under the category Communication.

dragSendEmail

 

In the Mapping Editor, we will map the properties of the email we would like to send. In the From property, we will enter “admin@example.com”. In the To property, we will use the mapping type “Build Array” and map the EmailAddress field of our form to Item 0. We will also map the Subject and Message fields in our form to the Subject and Message properties, respectively.

mappingToSendEmail

 

If the Customer in question has no email addresses listed, we would like to display a form explaining as much. For this purpose, we have pre-designed a form called Customer Has No Emails Form. We will find it in the Toolbox tab, under the category Forms [Interaction] > [Root Folder] > Designer Entities.

dragNoEmailForm

 

Once we’ve connected the remaining unconnected outcomes, our flow will be complete. We will save it and close the Flow Designer.

saveFlow

 

To be recognized as a folder action, we must restart the Service Host Manager service.

18.-restart_service.png

Back in the portal, we will navigate to a Customer folder and select the new Send Email to Customer action.

actionAdded

 

Because no emails have been listed for this customer, we will first see the Customer Has No Emails form.

noEmailResult

 

We will use the Contact Info Editor to define two email addresses for this customer, and then select the Send Email to Customer action again.

addEmailAddresses

 

In the resulting pop-up, we will see the Send Email to Customer form, containing the two email addresses that we added. We will select an email address, fill in a subject and message, and then click Send.

result

 

Our flow will send the email we defined to the address we selected in our form.

23.-email_received.png

Additional Resources