NERM - reassign an attribute to another that is comma separated

Hi all,

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.

Thanks in advance

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

Thanks Hussainssha,

how do I make an ordered list?

If the removed school equals Primary School, then you need to:

  1. Take the first value from Secondary School.

  2. Set that value as the new Primary School.

  3. Remove that value from Secondary.

  4. Rebuild Secondary without the removed school.

If the removed school is only in Secondary, then you simply remove it from the Secondary list and rebuild the comma-separated string.

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?

That is correct. I don’t know of any way to get one school name from the a list of schools names and then remove that from the list.

I know how the logic of it should work. My question is about technical implementation on how to achieve this.

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.

Specifically, this endpoint:

Additional reference: