Not able to set returnValue Object Keys

I receive the following error when trying to return an object from AppScript
Failed App Script type translation: Key 'Output' not found in returned object.

However my ReturnValue type in the automation is "Object".

This means I should be using the [StepName].[Key] format.
None of my keys are being found.
If I add the "Output" key in my returned object from AppScript then it finds it, but only the value from the "Output" key is available.

I return an object that looks like the following from AppScript...

let myObject = {"myKey1": "1", "myKey2" : "2", "Output" : "Not What I want" };
return myObject;

Then in my Automation I set the returnValue as an Object.
I setup 3 Keys.
myKey1 : LongText
myKey2: LongText
Output: Text

Then In my Data Action task, I set my columns
myColumn1 = [StepName].[myKey1]
myColumn2 = [StepName].[myKey2]

But this assigns only 1 of those columns with the value "Not What I want" and the other blank.

Removing the Output Key and definition causes nothing to be updated and the error to occur again.

0 3 102
3 REPLIES 3

If you didn't already, investigate whether it's a type compatibility issue. See the limitations and troubleshooting tips at the end of Use return values from Apps Script tasks - AppSheet Help

I also thought that was my issue originally, but the Object ReturnType is supposed to allow multiple different types. Either way mine do have the same return type and it still does not work.

I am going to simply have multiple calls for the different values until the object Keys work,


@MarkDM wrote:

mine do have the same return type


If you didn't already, be sure the script function is actually returning the type you expect--not just that you're assigning the same type within the AppSheet task.

Top Labels in this Space