Manipulating Data with If else Node

Good morning everyone, I’m not able to compare 2 values in the if else node, I need to compare all the data that returns from an api, and just get mine with the same “email” from another api, so update the data with reference to the ID of the other api.

I made 2 stream. one to register a user in the api and another to update that same user.

I’ll leave the stream I’m using here, I’ll also leave the data that returns in each search.

data it returns from the other api.

[
  {
    "contact": {
      "isPublished": true,
      "dateAdded": "2021-11-05T20:32:04-03:00",
      "dateModified": "2021-11-06T07:49:40-03:00",
      "createdBy": null,
      "createdByUser": null,
      "modifiedBy": 1,
      "modifiedByUser": "Admin Mautic",
      "id": 607,
      "points": 0,
      "color": null,
      "fields": {
        "core": {
          "id_perfex": {
            "id": "44",
            "label": "id_perfex",
            "alias": "id_perfex",
            "type": "number",
            "group": "core",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:2:{s:9:\"roundmode\";s:1:\"3\";s:5:\"scale\";s:0:\"\";}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "title": {
            "id": "1",
            "label": "Title",
            "alias": "title",
            "type": "lookup",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:1:{s:4:\"list\";a:3:{i:0;s:2:\"Mr\";i:1;s:3:\"Mrs\";i:2;s:4:\"Miss\";}}",
            "default_value": null,
            "value": "engine",
            "normalizedValue": "engine"
          },
          "firstname": {
            "id": "2",
            "label": "First Name",
            "alias": "firstname",
            "type": "text",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "agthon",
            "normalizedValue": "agthon"
          },
          "lastname": {
            "id": "3",
            "label": "Last Name",
            "alias": "lastname",
            "type": "text",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "estevam",
            "normalizedValue": "estevam"
          },
          "company": {
            "id": "4",
            "label": "Primary company",
            "alias": "company",
            "type": "text",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": null,
            "normalizedValue": null
          },
          "position": {
            "id": "5",
            "label": "Position",
            "alias": "position",
            "type": "text",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "email": {
            "id": "6",
            "label": "Email",
            "alias": "email",
            "type": "email",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "[email protected]",
            "normalizedValue": "[email protected]"
          },
          "mobile": {
            "id": "7",
            "label": "Mobile",
            "alias": "mobile",
            "type": "tel",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "phone": {
            "id": "8",
            "label": "Phone",
            "alias": "phone",
            "type": "tel",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "points": {
            "id": "9",
            "label": "Points",
            "alias": "points",
            "type": "number",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": "0",
            "value": 0,
            "normalizedValue": 0
          },
          "fax": {
            "id": "10",
            "label": "Fax",
            "alias": "fax",
            "type": "tel",
            "group": "core",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "address1": {
            "id": "11",
            "label": "Address Line 1",
            "alias": "address1",
            "type": "text",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "address2": {
            "id": "12",
            "label": "Address Line 2",
            "alias": "address2",
            "type": "text",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "city": {
            "id": "13",
            "label": "City",
            "alias": "city",
            "type": "text",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "state": {
            "id": "14",
            "label": "State",
            "alias": "state",
            "type": "region",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "zipcode": {
            "id": "15",
            "label": "Zip Code",
            "alias": "zipcode",
            "type": "text",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "country": {
            "id": "16",
            "label": "Country",
            "alias": "country",
            "type": "country",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "preferred_locale": {
            "id": "17",
            "label": "Preferred Locale",
            "alias": "preferred_locale",
            "type": "locale",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "timezone": {
            "id": "18",
            "label": "Preferred Timezone",
            "alias": "timezone",
            "type": "timezone",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "last_active": {
            "id": "19",
            "label": "Date Last Active",
            "alias": "last_active",
            "type": "datetime",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "attribution_date": {
            "id": "20",
            "label": "Attribution Date",
            "alias": "attribution_date",
            "type": "datetime",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "attribution": {
            "id": "21",
            "label": "Attribution",
            "alias": "attribution",
            "type": "number",
            "group": "core",
            "object": "lead",
            "is_fixed": "1",
            "properties": "a:2:{s:9:\"roundmode\";i:4;s:5:\"scale\";i:2;}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "website": {
            "id": "22",
            "label": "Website",
            "alias": "website",
            "type": "url",
            "group": "core",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          }
        },
        "social": {
          "facebook": {
            "id": "23",
            "label": "Facebook",
            "alias": "facebook",
            "type": "text",
            "group": "social",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "foursquare": {
            "id": "24",
            "label": "Foursquare",
            "alias": "foursquare",
            "type": "text",
            "group": "social",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "instagram": {
            "id": "25",
            "label": "Instagram",
            "alias": "instagram",
            "type": "text",
            "group": "social",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "0",
            "normalizedValue": "0"
          },
          "linkedin": {
            "id": "26",
            "label": "LinkedIn",
            "alias": "linkedin",
            "type": "text",
            "group": "social",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "skype": {
            "id": "27",
            "label": "Skype",
            "alias": "skype",
            "type": "text",
            "group": "social",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          },
          "twitter": {
            "id": "28",
            "label": "Twitter",
            "alias": "twitter",
            "type": "text",
            "group": "social",
            "object": "lead",
            "is_fixed": "0",
            "properties": "a:0:{}",
            "default_value": null,
            "value": "",
            "normalizedValue": ""
          }
        },
        "personal": [],
        "professional": []
      },
      "lastActive": null,
      "owner": {
        "createdByUser": null,
        "modifiedByUser": "Admin Mautic",
        "id": 1,
        "username": "admin",
        "firstName": "Admin",
        "lastName": "Mautic"
      },
      "ipAddresses": [],
      "tags": [
        {
          "id": 2,
          "tag": "faze02"
        }
      ],
      "utmtags": [],
      "stage": null,
      "dateIdentified": "2021-11-05T20:32:04-03:00",
      "preferredProfileImage": "gravatar",
      "doNotContact": [],
      "frequencyRules": []
    },
    "timestamp": "2021-11-06T07:49:42-03:00"
  }
]

In the value 1 of the IF node, change the value to: {{$item(0).$node["Set1"].json["email Cliente"]}}

1 Like

that’s right, very good for the help