Skip to content

Json Array to be used in Homeyscript #52

@chrisboer

Description

@chrisboer

It would be nice to get the "Result" from a previous flowcard to be used in a script.

For example

// Your JSON array as a string
var jsonString = Resultaat;

// Parse the JSON string into a JavaScript array of objects
var dataArray = JSON.parse(jsonString);

// Extract the value associated with "Etdy_ge1" from the dictionary at index 17
var valueAtIndex17 = null;
if (dataArray.length > 17 && dataArray[17].key === "Etdy_ge1") {
valueAtIndex17 = dataArray[17].value;
}

// Parse the value into a number (assuming it's a string representation of a float)
var parsedValue = valueAtIndex17 !== null ? parseFloat(valueAtIndex17) : null;

// Print or use the parsed value as needed
console.log("Parsed Value:", parsedValue);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions