Object.values fails in Application Integration Javasdcript Task

Hello,

I try to use the Object.values function to extract a Json values array in a Javascript Task.

The code is the following 

 

 

var ftpMapping = {"a": "1", "b": "2"}

 var transKeys = Object.keys(ftpMapping)
 var transValues = Object.values(ftpMapping)

 

 

The Object.keys function works as expected (returning a, b) but the code fails for line 4 with following error : Fail to execute the script due to TypeError: Cannot find function values in object function Object() { [native code for Object.Object, arity=1] }

It fails but in the editor the Object.values is proposed in the intellisense.

Is the .values not supported in Application Integration Javascript Tasks?

 

Solved Solved
0 2 138
1 ACCEPTED SOLUTION

2 REPLIES 2

Unfortunately, our JS task uses Rhino engine which doesn't support Object.values. 

https://mozilla.github.io/rhino/compat/engines.html#ES2017-features-Object-static-methods-Object-val...

Thanks for the feedback.

Regards