Blue Prism : Turn name into an email adress?

342 views Asked by At

I'm building an automation that reads an excel file with two columns (name and date), stores this to a collection and then sends out calendar invites based on those same parameters.

Extracting the data and sending the invites are both working fine individually but what I need to do now is convert the column that contains the names into email address format e.g. 'Person One' into '[email protected]'.

Added to this some of the 'name' rows contain two people in the following format - 'Person One & Person Two' so I'd need to split them into two seperate email addresses so they can both receieve the calendar invite for the appropriate date.

I'm guessing that I should be looking to do this using something in the 'Utility - Strings' function? Can anyone point me in the right direction? Much appreciated, thanks

Rota Example

needs to become

New Collection

1

There are 1 answers

1
esqew On

There are two major components you'll need to accomplish this conversion of a name to an email address:

  1. Split the initial list of recipients on the & (space-ampersand-space) sequence.
  2. For each of the recipients, calculate the e-mail address by replacing whitespaces with full stop (.) characters and appending the @email.com domain.

As such, your process would look similar to the following:

Process flow


You can use this in your Blue Prism 6.9 environment by saving the following XML as a .bpprocess or .xml file and importing it using the File > Import > Process / Object menu option in the Blue Prism Interactive Client:

<process name="Test Process" version="1.0" bpversion="6.9.0.26970" narrative="" byrefcollection="true" preferredid="f848bd78-240d-4b87-82b4-ade6ea8e40d8">
  <view>
    <camerax>0</camerax>
    <cameray>-21</cameray>
    <zoom version="2">1.25</zoom>
  </view>
  <preconditions />
  <endpoint narrative="" />
  <stage stageid="81bc6e0a-2151-4fae-80d7-3ad8d2d9826a" name="Start" type="Start">
    <display x="15" y="-105" />
    <onsuccess>69469193-4784-4519-bd10-974fb3d7e1da</onsuccess>
  </stage>
  <stage stageid="b527e78b-915b-4498-bf59-5f662104bb9d" name="End" type="End">
    <display x="15" y="165" />
  </stage>
  <stage stageid="92f4087e-5cdf-41a1-a889-088d7ef7c469" name="Stage1" type="ProcessInfo">
    <display x="-195" y="-105" w="150" h="90" />
  </stage>
  <stage stageid="f9d08d9a-ac87-4c6b-8aa9-2dc864ce8d8d" name="Input" type="Block">
    <loginhibit onsuccess="true" />
    <display x="-270" y="-45" w="150" h="60" />
    <font family="Segoe UI" size="10" style="Regular" color="7FB2E5" />
  </stage>
  <stage stageid="9fd57578-1b94-43f5-989e-f0fac142744f" name="Recipients" type="Data">
    <loginhibit onsuccess="true" />
    <display x="-195" y="-15" w="150" h="30" />
    <datatype>text</datatype>
    <initialvalue xml:space="preserve">Person One</initialvalue>
    <private />
    <alwaysinit />
  </stage>
  <stage stageid="5ea9beac-25e7-4560-9253-28706cf4f247" name="Output" type="Block">
    <loginhibit onsuccess="true" />
    <display x="-270" y="30" w="150" h="90" />
    <font family="Segoe UI" size="10" style="Regular" color="7FB2E5" />
  </stage>
  <stage stageid="71130d29-3d68-4809-809f-11429da8ca1d" name="Recipient Contacts" type="Collection">
    <display x="-195" y="75" w="150" h="60" />
    <datatype>collection</datatype>
    <private />
    <alwaysinit />
    <collectioninfo>
      <field name="Name" type="text" />
      <field name="Email" type="text" />
    </collectioninfo>
  </stage>
  <stage stageid="69469193-4784-4519-bd10-974fb3d7e1da" name="Utility - Strings::Split Text" type="Action">
    <loginhibit onsuccess="true" />
    <display x="15" y="-60" w="120" h="30" />
    <inputs>
      <input type="text" name="Text to Split" friendlyname="Text to Split" narrative="The text to split" expr="[Recipients]" />
      <input type="text" name="Split Char" friendlyname="Split Char" narrative="The split delimiter" expr="&quot; &amp; &quot;" />
      <input type="text" name="Collection Field Name" friendlyname="Collection Field Name" narrative="The name of the field for the resulting collection" expr="&quot;Name&quot;" />
    </inputs>
    <outputs>
      <output type="collection" name="Split Values" friendlyname="Split Values" narrative="The resulting collection containing the split values" stage="Split Values" />
    </outputs>
    <onsuccess>fe157559-e2e0-4a5d-95b7-4681fc9089ce</onsuccess>
    <resource object="Utility - Strings" action="Split Text" />
  </stage>
  <stage stageid="54353e0c-0125-4a3f-9870-8adc655e82a1" name="Split Values" type="Collection">
    <display x="165" y="-60" w="90" h="60" />
    <datatype>collection</datatype>
    <private />
    <alwaysinit />
  </stage>
  <stage stageid="fe157559-e2e0-4a5d-95b7-4681fc9089ce" name="Loop Split Values" type="LoopStart">
    <loginhibit onsuccess="true" />
    <display x="15" y="-15" w="150" h="30" />
    <onsuccess>1f522616-2dbf-4355-97f1-082fa9a00406</onsuccess>
    <groupid>31b533a9-c80b-49d2-bba7-2fa7f270cd72</groupid>
    <looptype>ForEach</looptype>
    <loopdata>Split Values</loopdata>
  </stage>
  <stage stageid="174f331c-b597-4053-aba2-e65f3f054f7c" name="Loop Split Values" type="LoopEnd">
    <loginhibit onsuccess="true" />
    <display x="15" y="120" w="150" h="30" />
    <onsuccess>b527e78b-915b-4498-bf59-5f662104bb9d</onsuccess>
    <groupid>31b533a9-c80b-49d2-bba7-2fa7f270cd72</groupid>
  </stage>
  <stage stageid="1f522616-2dbf-4355-97f1-082fa9a00406" name="Add Row to Output Collection" type="Action">
    <loginhibit onsuccess="true" />
    <display x="15" y="30" w="120" h="30" />
    <inputs>
      <input type="text" name="Collection Name" friendlyname="Collection Name" narrative="The name of the collection to act upon" expr="&quot;Recipient Contacts&quot;" />
    </inputs>
    <onsuccess>6547bfb9-ae7e-4735-96b4-07fbca2678f0</onsuccess>
    <resource object="Blueprism.AutomateProcessCore.clsCollectionActions" action="Add Row" />
  </stage>
  <stage stageid="6547bfb9-ae7e-4735-96b4-07fbca2678f0" name="Store Name and Calculated Email for Recipient" type="MultipleCalculation">
    <loginhibit onsuccess="true" />
    <display x="15" y="75" w="120" h="30" />
    <onsuccess>174f331c-b597-4053-aba2-e65f3f054f7c</onsuccess>
    <steps>
      <calculation expression="[Split Values.Name]" stage="Recipient Contacts.Name" />
      <calculation expression="Replace([Split Values.Name], &quot; &quot;, &quot;.&quot;) &amp; &quot;@email.com&quot;" stage="Recipient Contacts.Email" />
    </steps>
  </stage>
</process>