Your variable string should start as '’ and in the iterator place the following expression in the change variable action:
trim($varString + ' ' + (if $Production_Number/ProductionCode != empty then getKey($Production_Number/ProductionCode) else ''))
You can use a seperator if you want and you need to check if productioncode != empty to prevent exceptions using the getKey.
Edit, I'm using Pro, this is quote quote.
I missed a closing bracket in my initial expresion for the getKey. Its updated now.
Hello Sjors Schultz,
Thank you for your reply! how should I set the initial value as '’ I tried writing it on the Mendix “set initial value to” space and I think I'm not doing it right, sorry I'm new to this .
Then for the expression in the change variable action I get the following which does not let me use it: