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.
@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!
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.
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.
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.
Then set the flow as follow.
This is the field value.
This is the email.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156