I have a use case where I want users to be able to remove a school from a profile but only the school assigned to the requester. When they do that, if it is a primary school, then the first value of the secondary school which is like “school1, school2, school3 …“ should replace primary school. (If primary school is “school A”, then after removal, it should be primary school = “school1” and secondary school = “school2, school3, …”
If the school being removed is secondary, then secondary should just change to “school2, school3, …” or any other school that is removed. The schools have already been assigned to different users who will perform this action.
My plan is to get the requester’s school and check if the primary is same as it or if secondary includes it but I’m not sure where to go from there.
yes you go to that plan “to get the requester’s school and check if the primary is same as it or if secondary includes it” ..make one ordered list that holds all and remove requestors school
If I’m not mistaken, your particular challenge is that there’s no list element operation available in NERM workflows. e.g. You are not able to programatically insert / delete list elements from the CSV string value. Correct?
The workaround / hack we have is to leverage Liquid Template in the JSON of a Workflow REST API action step. In the liquid template, you can eval and split the current CSV into a list, programmatically have a for loop to evaluate what to add or remove, then send this out as a JSON payload back to NERM itself as a profile modification / update by updating the workflow session. Now you have the new CSV in the workflow session / context.
It’s very ‘dumb’…and this was 6 months ago. Not sure if there’s any enhancement / better way since then.