web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Parse string and pass these values to Email template

(0) ShareShare
ReportReport
Posted on by 15

Hi, 

One of our entity field contains coma separated values. I want to write a workflow, which is triggered when this field contains data. 

Task is to split those values after coma, find out how many elements are there and send them as separate text in an email. 

I saw this utility,https://github.com/jlattimer/CRM-String-Workflow-Utilities. But how can I get result back once I perform substring. Is there a list variable in Workflow where I can save those values and pass to my Send Email Action who then send these. E.g.

Field1 = 123,Test,567,Summer,BlaBla

Need to know how many elements are there e.g. 5 element and send an email like this. 

You have 5 element in your field. 

Element 1: 123

Element2: Test

Element3: 567

Element4: Summer

Element5: BlaBla

Can it be achieved in Workflow & via Email Template? If yes, please guide. 

I have the same question (0)
  • Verified answer
    LuHao Profile Picture
    40,892 on at

    Hi partner,

    The easiest way is to split field values through Power Automate and send emails, which is also a no-code way.

    Background: In the Contact, there is a field "test" which contains comma separated values, when it is changed, I need to send an email as your provided.

    Go to https://make.powerapps.com/, select the D365 environment and click Flow, then new a auotemated flow.

    pastedimage1602837042358v1.png

    Then set the flow as follow.

    pastedimage1602837257331v2.png

    This is the field value.

    pastedimage1602837351342v4.png

    This is the email.

    pastedimage1602837310838v3.png

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    In addition to that you can also build a custom workflow where you can split these values and concatenate into string variable and return as output from your workflow, this output variable you can use while designing your email step in workflow.

    you can refer how to use output variable.

  • Suggested answer
    Javed Iqbal Profile Picture
    85 on at

    I don't know if you can JS but this can be very easily achieved using simple script.

    function myFunc(ExecutionContext) {

     var formContext=ExecutionContext.getFormContext()

     var str = formContext.getAttribute("<fieldname>").getValue()();

     var array = str.split(",");

     var noOfElement= array.length;

     // you can even loop through each element

     //for (var i=0; i<array.length; i++){

     // alert(array.length);

     //}

    }

    simply call this function onChange event of field and you will have result in noOfElements variable.

  • HoomDoom Profile Picture
    15 on at

    @Lu Hao  Can you please re-post the 2nd image (setting up the flow). It is not readable. May be split it in multiple images. Thanks!

  • Suggested answer
    LuHao Profile Picture
    40,892 on at

    pastedimage1603099995474v1.png

    pastedimage1603100018864v2.png

    pastedimage1603100039981v3.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 62 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Pallavi Phade Profile Picture

Pallavi Phade 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans