How to pass the name of a property as a parameter to an activity and update that property in the activity

I want to be able to update properties in a case via an activity (or data transform). But the property being updated could be different each time, so I want this activity to be reuseable.

Is there a way to pass the name of the property to be updated AS A PARAMETER and have this property updated with a value (also passed as a parameter) using either an activity or data transform?

@RobertH9685
Send the Property name as a param to a DataTransfrom and use when conditions to determine and set corresponding property value under when condition. you can write multiple when conditions for different params values.

@RobertH9685 Hi, if the list of properties to update is too long for the above approach to make sense - you can use the setPropertyValue function from RuleManagement library.

@walol First of all, thank you for your response and the timely manner. I have been able to make this work with some syntax changes.

This function will update the property (param.Pname) with a new value (param.Pvalue)

@RuleManagement.setPropertyValue(myStepPage,param.Pname,param.Pvalue)

This is done in an activity rather than a data transform.

The activity takes the following parameters;
InsKey - .pzInsKey

Pname - Property name - must be the full path of the property (eg - “.Page1.Page2.PropertyToUpdate”

Pvalue - Value for the property being updated

WorkPage - Always passed as “pyWorkPage”

Key Activity steps as follows;

  1. Obj-Open-By-Handle (WorkPage)

  2. Property-Set (WorkPage)

@RuleManagement.setPropertyValue(myStepPage,param.Pname,param.Pvalue)

  1. Obj-Save (WorkPage)

This works for most property types - (Text, Int, Decimal, boolean) - Date will need to be converted if your parameter is a text format.