I had to convert a multiselect field into a “Link to another table”

I prepared a scenario in Make for this purpose Blueprint can be downloaded here:

Transclude of convert-multiselect-into-link-to-another.json

I came up to a problem with updating an array field: when Cliend_Services array was empty it is not returned in the response json and using add was not enough since add(null;id) returned null. I had to check if the array is empty using ifempty function and if so I used a predefined empty array (emptyarray) as a base array to add to. This way when the Client_Services array is empty the empty array is used and the result of the code below:

{{add(ifempty(2.Client_Services; emptyarray); 1.id)}}

is that the array contains only one element.