If else sequentially

I have node that return json array output, inside json array is json object.
What I want to achieve is to check if a boolean inside each json object, if it’s true do node A else node B.
My problem is, for example I have 3 json objects: true, false, true (in order)
When I use if-else node, it will go to node A(true) twice then go to node B(false).
What I want is run Node A, Node B, Node A in order.

1 Like

Hey @100nandoo,

Can you share the json data you are working with and your workflow so we can take a look?

My workflow code

Here is the json

[
  {
    "is_title": true,
    "link": "https://www.reddit.com/r/SonyAlpha/comments/13pshv4/submitting_a_photo_for_competition_which_one/",
    "title": "Submitting a photo for competition, which one??",
    "image": ""
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/oz9haifesl1b1.jpg?width=4840&format=pjpg&auto=webp&v=enabled&s=7df495d4784630cda8723a7c97390397b9276af5"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/kse52ifesl1b1.jpg?width=4328&format=pjpg&auto=webp&v=enabled&s=21e004042210b2fca25270cc850ee4425211b619"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/q5r6yifesl1b1.jpg?width=5585&format=pjpg&auto=webp&v=enabled&s=ab88b3665293bd87ecacd28462b831ebeb6abfc9"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/ur6dpjfesl1b1.jpg?width=5788&format=pjpg&auto=webp&v=enabled&s=d6ffb39dffa2b605d9c646ce91fbe8f5aa877327"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/fi7ryifesl1b1.jpg?width=2743&format=pjpg&auto=webp&v=enabled&s=ed4349f3107beb62aa0aea3145d38f014517a1be"
  },
  {
    "is_title": true,
    "link": "https://www.reddit.com/r/SonyAlpha/comments/13rm0ku/shots_from_a_chicago_trip_sony_a7iv_with_sigma/",
    "title": "Shots from a Chicago trip. Sony a7iv with sigma 24-70mm 2.8",
    "image": ""
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/fhlggxg3602b1.jpg?width=4672&format=pjpg&auto=webp&v=enabled&s=4064ad7d742f6bb6e9907082eed225444af943be"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/ffcj7xg3602b1.jpg?width=4345&format=pjpg&auto=webp&v=enabled&s=4fb2bdaa60471bb021887f775b07d1776c629b6f"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/d67vnxg3602b1.jpg?width=4078&format=pjpg&auto=webp&v=enabled&s=b093e95d9630a16b56576ed91e71edce86fc672d"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/wk2eaxg3602b1.jpg?width=4099&format=pjpg&auto=webp&v=enabled&s=bbf48e31260b986a24922e50452232f90c7b7d08"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/h88tkxg3602b1.jpg?width=4624&format=pjpg&auto=webp&v=enabled&s=30c6341667d2528505d8d89fe90343ff93fd89ca"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/om9mbxg3602b1.jpg?width=3198&format=pjpg&auto=webp&v=enabled&s=01d9dea722d4e394bf254731741ffa5740dcb8eb"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/cpftnwg3602b1.jpg?width=4672&format=pjpg&auto=webp&v=enabled&s=3b1446c0d40c1758709c8404029ae33ba7c28f55"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/x9imy2h3602b1.jpg?width=4672&format=pjpg&auto=webp&v=enabled&s=5b90643aa6f0991aa68ed6309ba40280c932b5d8"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/1ffnhxg3602b1.jpg?width=4185&format=pjpg&auto=webp&v=enabled&s=260d1dc920af476d46e84c21acceb4f3d834cf5c"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/9xkcjxg3602b1.jpg?width=3671&format=pjpg&auto=webp&v=enabled&s=08f224d9e754fa7fdd6a9c02f3201628ec010964"
  },
  {
    "is_title": true,
    "link": "https://www.reddit.com/r/SonyAlpha/comments/13rcwdk/sony_a7iii_sigma_150600mm/",
    "title": "Sony A7III & Sigma 150-600mm",
    "image": ""
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/n5m6h3bs4y1b1.jpg?width=1080&format=pjpg&auto=webp&v=enabled&s=3c6539cddc90a8fdc52aeebc15828a368c5303ed"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/b9fev2bs4y1b1.jpg?width=4000&format=pjpg&auto=webp&v=enabled&s=3aa269d6b75c9499ff387da00496a60b87bdfd73"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/gqi2a3bs4y1b1.jpg?width=1080&format=pjpg&auto=webp&v=enabled&s=707127c85f5cb799c7d5d8e704bdb0a4da646eb6"
  },
  {
    "is_title": true,
    "link": "https://www.reddit.com/r/SonyAlpha/comments/13r1yno/sony_a1_and_200600_g/",
    "title": "Sony A1 and 200-600 G",
    "image": ""
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/0o1ez7bw9v1b1.jpg?width=7334&format=pjpg&auto=webp&v=enabled&s=63039b9358d183a98d9adb818fc4b7b51289b946"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/u912o8bw9v1b1.jpg?width=8306&format=pjpg&auto=webp&v=enabled&s=a2cc3f15b79931c66802d423f24780b998f5e103"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/dd0r18bw9v1b1.jpg?width=8172&format=pjpg&auto=webp&v=enabled&s=9034a5c6daf89b50f4875aca75fa9af0ca811f09"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/rjivu7bw9v1b1.jpg?width=7690&format=pjpg&auto=webp&v=enabled&s=f7b0ea9ee0d0761e27e3ee62e34c496ffa37e8b6"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/7tk6n7bw9v1b1.jpg?width=7841&format=pjpg&auto=webp&v=enabled&s=b9bc6239191291847d8068fd4314c0d6cf5d45f7"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/c32847bw9v1b1.jpg?width=8640&format=pjpg&auto=webp&v=enabled&s=19cb676765607f76b25205f5e985962efe61d54d"
  },
  {
    "is_title": true,
    "link": "https://www.reddit.com/r/SonyAlpha/comments/13pphfa/first_attempt_at_motorsport_any_tips_α7ii_w_70200/",
    "title": "First Attempt at Motorsport, any tips? | α7ii w/ 70-200 G",
    "image": ""
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/0o1f7x298l1b1.jpg?width=4412&format=pjpg&auto=webp&v=enabled&s=8aba57081d6c291b546d32a7eecbc639a776fa5f"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/pz2h5z298l1b1.jpg?width=4669&format=pjpg&auto=webp&v=enabled&s=cb9c2dac622d3394556d2f747037c14929a5f717"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/dspni0498l1b1.jpg?width=6024&format=pjpg&auto=webp&v=enabled&s=5265284fd5e771958cd5109d2a444177145dac78"
  },
  {
    "is_title": false,
    "link": "",
    "title": "",
    "image": "https://preview.redd.it/4s4dww298l1b1.jpg?width=6024&format=pjpg&auto=webp&v=enabled&s=e41142e4f9bda9214599f25de84351d435b01496"
  }
]

Basically if is_title is true send a text message to telegram channel if is_title false send image

Hey @100nandoo,

That looks ok to me, So we should process items in the order they arrive in the node but it is worth noting that the UI may look like something else is happening.

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