Me and my colleague @Rune Andersland are trying to solve the exact same issue as you. Will let you know if we find a solution.
I was a long time ago given an expression crib sheet from Axios and it included this expression. (I have never used it and I have amended to your shortCode above)
if($new.W("MSL-BU").shortCode = "OPTION1", $NO_VALUE,
if($new.W("MSL-BU").shortCode = "OPTION2", $NO_VALUE, $NO_VALUE))
The below is a working exaple of dynamic task expressions dependent on the value selected from a single-select lookup if that is of any use
if($new.W("BARCLAYS_AMEND ACCES PROFILE_ROLE DEFINITION").shortCode = "TREASURY SYSTEMS","TREASURY SYSTEMS",
if($new.W("BARCLAYS_AMEND ACCES PROFILE_ROLE DEFINITION").shortCode = "TREASURY","TREASURY",
if($new.W("BARCLAYS_AMEND ACCES PROFILE_ROLE DEFINITION").shortCode = "BACK OFFICE","BACK OFFICE",
if($new.W("BARCLAYS_AMEND ACCES PROFILE_ROLE DEFINITION").shortCode = "FINANCE","FINANCE",
if($new.W("BARCLAYS_AMEND ACCES PROFILE_ROLE DEFINITION").shortCode = "TAX","TAX",
if($new.W("BARCLAYS_AMEND ACCES PROFILE_ROLE DEFINITION").shortCode = "INSURANCE","INSURANCE",
if($new.W("BARCLAYS_AMEND ACCES PROFILE_ROLE DEFINITION").shortCode = "Z_OTHER","Z_OTHER",$NO_VALUE )))))))
Hi Kevin
The way I have handled this in the past is to
- Create a string field on the form that the other users cannot see
- Add a “system” Stage and Task to the process before the stage where you want your dynamic task to trigger
- Have associated with the creation of the above Task, a SmartMail job that will gather the values from the multi select values and format them in an array string that looks like as follows
r“ASSYST”,”ASSYSTNET”,”ASSYSTWEB”,”ASSYSTDB”] - That Smartmail job has an update_event_ejb call that places that string in the aforementioned field you have created. Lets say that field short code is called SYSTEMS
{"update_event_ejb",
eventId = ,< PARENT_EVENT_ID ]],
customFields =
{
{ customFieldShortCode = "SYSTEMS",
stringValue = ""..ARRAY_STRING
},
}
]],
},
-
It then closes the task moving onto the next stage for which the Dynamic Task expression reads $new.W(“SYSTEMS”).value
-
Which for the above example string will produce 4 tasks for each element in that array, i.e. the systems chosen.
If those values were valid item short codes then they can be substituted into the item A or B fields with the simple $DYNAMIC_TASK_VALUE expression returned for having a dynamic task expression