How to use Expressions when json are in unamed object

Hello,

How to select last node return json:

[{ "metrics": { "annualRevenue": "XXX" } }]

How to write this expression in n8n? Cause the first object nothing is working well for me.

Tried:
{{$node[“ClearBit”].json[“metrics”][“annualRevenue”]}}
{{$node[“ClearBit”].json[0][“metrics”][“annualRevenue”]}}

Hey @MatheusRV!

Looking at the output you shared, your field is named annualRevenue while you’re trying to get the value for estimatedAnnualRevenue. Can you please make sure that the field names are same?

Also, can you share the workflow? A dummy workflow with the similar result might also work. :slightly_smiling_face:

Thanks

I write name wrong, both vars exist

I can just repeat that what @harshil1712 wrote sounds to 100% correct to me. The following ones should work perfectly looking at the screenshot you did post:

{{$node["ClearBit"].json["metrics"]["annualRevenue"]}}
{{$node["ClearBit"].json["metrics"]["estimatedAnnualRevenue"]}}

Anyway both of them are null so the output will be empty.

To check if it outputs data correctly you can test with another property which has actually a displayable value set like “employeesRange”:

{{$node["ClearBit"].json["metrics"]["employeesRange"]}}