API returns JSON object instead of Array - Cannot use items node

Describe the problem/error/question

I get the following API response from the LastPass API. How can I transform the following JSON to be used in the item node as I get the error that is no Array? I want to split out the Users and its fields and use it in the rest of the flow

[
{
“total”: 41,
“count”: 41,
“Users”:
{
“161151992”:
{
“username”: “[email protected]”,
“field”: “x”
},
“172898622”:
{
“username”: [email protected],
“field:” “y”,
}
]

Hey @timautomation,

As the Users items in the object isn’t an array it is a bit trickier, What is the format you want to have the data in are you just after the usernames and fields or do you need the ID in there as well

Hi Tim,

Try this code node.

4 Likes

Hi BramKn

You are awesome! Thanks worked like a charm :slight_smile:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.