Pass ServiceTask InputParameneter to Output parameter

I create ServiceTask input parameter via JavaScript expression. And I want to make this parameter to be an output parameter also. I do something like this

but getting error
The value ‘DynamicObject@7c7bef’ cannot be passed from one context to another. The current context is 0x16aaf8c and the argument value originates from context 0x1471e88."}

Hi @Gennadich ,

How about using ${ControlDateString} as a expression while using String or Expression Variable Assignment Type? I believe it should do the trick.

Thank’s. This creates the variable of type Object with value com.oracle.truffle.polyglot.PolyglotMap<java.lang.Object,java.lang.Object>
How to convert It to more user friendly representation?

Could you post the whole script in the input parameter that creates ControlDateString local var?

var daysAdd = 7;
var dateAdded = new Date(TransferAcceptanceSignDate);
dateAdded.setDate(dateAdded.getDate() + daysAdd);
var dateRest = new Date(dateAdded.getTime() - (dateAdded.getTimezoneOffset() * 60000));
ControlDateString = dateRest;

But, I found out that this work’s if I make ControlDateString = dateRest.toISOString(); but It becomes string type. So the question is why I cant have the date out parameter?