Parameter in expression

Hi,
I’m integrating Facebook with my marketing automation solution, and when a lead is sent from Facebook, I need to check whether it already exists. The result of this check is the following, in case the lead already exists:

[
{
“total”: “1”,
“contacts”: {
“3720”: {
“isPublished”: true,
“dateAdded”: “2021-07-21T12:37:10+00:00”,
“dateModified”: “2021-07-21T18:01:37+00:00”,
“createdBy”: 3,
“id”: 3720,
“points”: 0,
“color”: null,
“fields”: {
“core”: {
“points”: {
etc.

Further along in my flow, I need to reference the values in [contacts][3720][fields][core]. The problem is that 3720 is the id of the lead in my marketing tool, as a result of the GET request, and thus is different for each lead.
How can I build an expression that dynamically updates the proper id value so that the attributes in the json can be accessed? Something like {{$node[“Get MT”].json[“contacts”][“id parameter”][“fields”]["core][“situacao”] is what I need.
Thanks a lot,
Christophe

Hey @cdesseaux,

I’ve created a small workflow that demonstrates this. Assuming that the actually ID is the first key in the Contact object, the expression used the Set node will now get the value dynamically.

Great! That works splendidly. Thanks, @harshil1712 !

1 Like