How do I combine multiple field values in to one string?

Hello,

I have a Method Directive BPM on ‘Erp.BO.InventoryQtyAdj.SetInventoryQtyAdj’.

I was asked if I could send an email with multiple fields in it.

That I can do.

My problem is they want the Serial Numbers to pass into the email also.

If it only has one serial number, it works fine.

I need it to be able to send multiple serial numbers separated by a comma.

It looks like the relevant serial numbers are stored at: dsSelectedSerialNumbersRow.SerialNumber

How would I be able to combine all the serial numbers within the C# Expression box for a set variable?

image

Any help is appreciated.

I would probably create a custom code widget in between, and use it to set a string variable. So create a string type variable for the BPM called something like AllSerialNums

var SNList = ttSelectedSerialNumbers.Where( x => x.Updated() ).Select( s => s.SerialNumber ).ToArray();

AllSerialNums = String.Join(",", SNList);
3 Likes

Thank You!

This just a couple of small modifications, it did exactly what I needed!

I had to change Updated() to Added() and change the variable name from AllSerialNums to the one I already had created.

You are a life saver!

2 Likes

Excellent, glad it worked!