Getting error: 400 - Object.keys is not a function

In a codeless function, I use the “Get Object Keys” block. Until I changed the function an hour ago, it worked well. After I changed the function, added and deleted some blocks, I get the error: “400 - Object.keys is not a function”. When I delete the block and replace it by creating a list, my codeless functions works again well.

My object where I want to get the keys from looks like this (output of the code: “JSON.stringify(KeyValuePairs)” ):


{"@EventTimestamp@":"2017-10-19T09:09:38.946Z","@AcquName@":"string","@AcquTag@":"string","@AcquDescription@":"string","@ID@":540,"@UserName@":"Jonas
 Eberhard"}

The “Get Object Keys” block is translated to the following code:

NotificationTextTags = (Object.keys(KeyValuePairs));

The Object key value pairs is created with a codeless Create Object block and the code looks like this:

KeyValuePairs = ({ '@EventTimestamp@': (new Date()),'@ID@': (Object['ID']), .... });

Hey Jonas

Providing ‘before’ and ‘after’ screenshots of your codeless logic would really help us to investigate the problem

Best Regards

Hi Anton,

poorly I cannot show you the previous version of the function, I haven’t any old saved state.

The new one looks like this. The cut off if which extends on the top, are only more else if paths.
http://support.backendless.com/public/attachments/915929a29a0bc605ec412c6bd2d22aa3.PNG</img>

Hi Jonas

the problem is with your argument block “Object”, “Object” is a native JS variable,

so just rename your argument block “Object” and it will solve the problem

Regards, Vlad

Thanks very much :slight_smile: Never thought on that, but it’s obvious…