Server Script: how to use "keys and values"?

Please explain what am I doing wrong in Server Script (Java script in Bubble workflow)? I wanna create a new variable in “keys and values”. How to address it in “Node script”?

Addressing it as “properties.keyvalues.temp” or “properties.temp” is not functioning.

1 Like

Hi,

First problem: The ‘Node script’ returns a variable of numeric datatype as string.
Example: “let a = 123” is inferred as string.

Try doing this on the last line: parseFloat(myres) and set your return type to string. This worked for me (I was not using properties.keyvalues.temp at this stage).

Second problem: The argument properties.keyvalues.temp returns as undefined. Not sure why.

Tip: You can create a plugins where you can easily write Javascript and loop “things”. I find this to be more robust.

1 Like

My preferred method for using js with bubble

2 Likes

hey @dimitri.korenev to access the keyvalues data you need to do it like this: properties.keyvalues[0].value

2 Likes