Question

Set process parameter in script task

Hi,

how would I go about setting the process parameters in the screenshot, for instance the code for CellPhoneNumber is CellPhoneNumber. I have tried 

Set>("CellPhoneNumber", CellPhoneNumbers);

and

Set>("Collection.CellPhoneNumber", CellPhoneNumbers);

but for both I get the error that the process parameter does not exist

Thanks,

Like 0

Like

3 comments

Hi Tyler,

If the process parameter is a string/text param, all you need to do is:

Set("ParamName", "The param value");

(I don't see a screenshot in your post so not sure if it's something other than a simple text param)

Ryan

Ryan Farley,

Thank you for the response, I have now uploaded the screenshot

If it's a collection that does change things slightly with how you use it. The type of collection would matter (if a collection of records or collection of values etc). 

To add a record into the collection it would look something like this, assuming the param is a collection of records - based on your screenshot and assuming you're adding a new item to the collection:

// create collection/list
var list = new CompositeObjectList<CompositeObject>();
 
// create item and add to collection/list
var item = new CompositeObject();
item["CellPhoneNumber"] = "800-555-1212";
item["SomeOtherParamInCollection"] = "Some value, etc";
list.Add(item);
 
// now set in param
Set <CompositeObjectList<CompositeObject>>("MyCollectionParamName", list);

See more here https://customerfx.com/article/working-with-collection-parameters-in-a-…

Ryan

Show all comments