If condition

Hello,
I’m practicing with error handling.

I added repeater 1 to 3
output bundle:
[
{
“i”: 1
},
{
“i”: 2
},
{
“i”: 3
}
]

In the HTTP make request module
In the URL field:
https://httpstat.us/{{if(9.i + “=2”; 400; 200)}}

When I execute:
“url”: “https://httpstat.us/400
It’s wierd but the if condition is always returning 400

  • Operation 1

Input

  • Bundle 1Collection

    • Self-signed certificate

empty

* Query String<small>Array</small>

* URL

https://httpstat.us/400

* Request compressed content

true

* Method

get

* Headers<small>Array</small>

* Timeout

empty

* Use Mutual TLS

false

* Password

empty

* User name

empty

* Body type

empty

* Serialize URL

false

* Share cookies with other HTTP modules

false

* Parse response

false

* Follow redirect

true

* Disable serialization of multiple same query string keys as arrays

false

* Follow all redirect

false

* Reject connections that are using unverified (self-signed) certificates

true

Handled error

  • type

DataError

  • message

Error: 400 Bad Request

  • detail

400 Bad Request

  • Data size: 0

Operation 2

Input

  • Bundle 1Collection

    • Self-signed certificate

empty

* Query String<small>Array</small>

* URL

https://httpstat.us/400

* Request compressed content

true

* Method

get

* Headers<small>Array</small>

* Timeout

empty

* Use Mutual TLS

false

* Password

empty

* User name

empty

* Body type

empty

* Serialize URL

false

* Share cookies with other HTTP modules

false

* Parse response

false

* Follow redirect

true

* Disable serialization of multiple same query string keys as arrays

false

* Follow all redirect

false

* Reject connections that are using unverified (self-signed) certificates

true

Handled error

  • type

DataError

  • message

Error: 400 Bad Request

  • detail

400 Bad Request

  • Data size: 0

Operation 3

Input

  • Bundle 1Collection

    • Self-signed certificate

empty

* Query String<small>Array</small>

* URL

https://httpstat.us/400

* Request compressed content

true

* Method

get

* Headers<small>Array</small>

* Timeout

empty

* Use Mutual TLS

false

* Password

empty

* User name

empty

* Body type

empty

* Serialize URL

false

* Share cookies with other HTTP modules

false

* Parse response

false

* Follow redirect

true

* Disable serialization of multiple same query string keys as arrays

false

* Follow all redirect

false

* Reject connections that are using unverified (self-signed) certificates

true

Handled error

  • type

DataError

  • message

Error: 400 Bad Request

  • detail

400 Bad Request

I tried using a variable for the condition but i still have the same problem.
What I’m missing?
Thank you
Regards.


Hello @Carlos4,
Please share a screenshot.

Added the screenshots,

https://httpstat.us/{{if(9.i + “=2”; 400; 200)}}

It is supposed to set a variable data in the tools when repeater is 1 an 3
and receive the 200 ok response, right?

What I’m missing?

Hello @Carlos4,
Check function syntax first and how to use function syntax with its default toolbox.

In your current issue, it’s just “=” use from Make’s default toolbox later you can use a shortcut when you use it more.

:+1: