Extract Value of a key using JS in logic

{
    "records": [
        {
            "id": "recscVGYqY0aCvfUK",
            "fields": {
                "Name": "Kenny",
                "Customer": [
                    "recOouZ1nmfKhybBt",
                    "recJ2s5X6eVrXsanq"
                ],
                "WhatsApp": "886905617857",
                "Employee": "1 Kenny",
                "Record Id": "recscVGYqY0aCvfUK",
                "Total Invoice": 0,
                "Sequence ID": 1
            },
            "createdTime": "2021-09-01T13:24:17.000Z"
        }
    ]
}

I have a response above. Now i want to use login JS to extract “Kenny” (the value of the NAME key)

How can i construct the JS? i am so confused with the UI

Here is the flow

The input is “response body in json format” already

Hey,

Is using JS necessary? You could probably do this with a formula like outputs["HTTP Request"].response.records[0].fields["Name"] or something very similar. But JS would be the same,

> var name = inputs.input1.records[0].fields["Name"]
> return [0, {result: name}]
1 Like

Thanks. I just figured it out. Thank you so much

1 Like