Backendless Support
 
Solved

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)" ):

  1. {"@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:

  1. NotificationTextTags = (Object.keys(KeyValuePairs));

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

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

Leave a Comment

Comments (4)

photo
1

Hey Jonas

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

Best Regards

photo
1

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.

915929a29a0bc605ec412c6bd2d22aa3

photo
1

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

photo
1

Thanks very much :) Never thought on that, but it's obvious...

photo