extract value from array

Options

External API response is a single array with decimal value in it.

last: [31.8]

How do I extract the value to be able to use it for math operations after? The value is dynamic and pulling from external API.

Answers

  • Liz Anaya
    Liz Anaya Member, Administrator

    ADMIN

    Options

    Hey @TJ!

    You can save the number by mapping to it using dot notation.

    Assuming that the External API response is in the form of an object, like this:
    {"last":[31.8]}

    Here is what it would look like.


    You can then use the variable number to perform mathematical operations.