# \#if-else

**URL:** https://community.postman.com/tag/if-else/422.md

[Latest](https://community.postman.com/latest.md) · [Categories](https://community.postman.com/categories.md) · [Tags](https://community.postman.com/tags.md)

---

## [Chaining GraphQL requests based on answer-body or variable](https://community.postman.com/t/chaining-graphql-requests-based-on-answer-body-or-variable/62700)

<div class="topic-metadata">

**Author:** [@joint-operations-as5](https://community.postman.com/u/joint-operations-as5)\
**Replies:** 0\
**Last updated:** [June 27, 2024, 8:04am UTC](https://community.postman.com/t/chaining-graphql-requests-based-on-answer-body-or-variable/62700 "2024-06-27T08:04:06Z")

</div>

Hello everyone, I am currently trying to chain multiple GraphQL requests based on the answer-body of the first request. With my first request I request an authenticationToken. Then I want to check if I recived a token o…

---

## [IF block in Flow not working](https://community.postman.com/t/if-block-in-flow-not-working/58999)

<div class="topic-metadata">

**Author:** [@legiuffre](https://community.postman.com/u/legiuffre)\
**Replies:** 1\
**Last updated:** [March 19, 2024, 5:12pm UTC](https://community.postman.com/t/if-block-in-flow-not-working/58999 "2024-03-19T17:12:46Z")

</div>

Hello Postman community I am struggling to understand how the IF blocks work within Postman Flows because it doesn’t work as I expected it to and I might be doing something incorrectly. Here is my if setup: The n\_cu…

---

## [Use IF statement to check if data field in nested array exists, and if it exists set the value to a variable](https://community.postman.com/t/use-if-statement-to-check-if-data-field-in-nested-array-exists-and-if-it-exists-set-the-value-to-a-variable/49227)

<div class="topic-metadata">

**Author:** [@chris.ohare](https://community.postman.com/u/chris.ohare)\
**Replies:** 2\
**Last updated:** [July 7, 2023, 3:46am UTC](https://community.postman.com/t/use-if-statement-to-check-if-data-field-in-nested-array-exists-and-if-it-exists-set-the-value-to-a-variable/49227 "2023-07-07T03:46:35Z")

</div>

My question: I want to capture data from three objects in a JSON response, however, two of the objects are always in the response, and one is not always there (by design). Additionally, the first two objects that are alw…

---

## [Check if array contains 'true' or 'false' flag in Response](https://community.postman.com/t/check-if-array-contains-true-or-false-flag-in-response/48552)

<div class="topic-metadata">

**Author:** [@gonsag](https://community.postman.com/u/gonsag)\
**Replies:** 6\
**Last updated:** [June 19, 2023, 10:32pm UTC](https://community.postman.com/t/check-if-array-contains-true-or-false-flag-in-response/48552 "2023-06-19T22:32:29Z")

</div>

Hi team, I have an array which contains the flag as : \[false, true, false\] and so on. I wrote code to fetch out using contains, include, have.property and others as an ‘if’ condition and unable to trigger the condition …

---

## [Writing test with if/else statements](https://community.postman.com/t/writing-test-with-if-else-statements/12304)

<div class="topic-metadata">

**Author:** [@martigi](https://community.postman.com/u/martigi)\
**Replies:** 7\
**Last updated:** [April 24, 2023, 8:32pm UTC](https://community.postman.com/t/writing-test-with-if-else-statements/12304 "2023-04-24T20:32:06Z")

</div>

Hello, I am attempting to write tests for the response. My issue that I am experiencing is that if the results will either be a “SUCCESS” or an “ERROR”, but the call will always return a status code of 200. My real pro…

---

## [Is there anyway to check status code with if-else condition for testing?](https://community.postman.com/t/is-there-anyway-to-check-status-code-with-if-else-condition-for-testing/36582)

<div class="topic-metadata">

**Author:** [@masum-abid](https://community.postman.com/u/masum-abid)\
**Replies:** 4\
**Last updated:** [March 23, 2023, 8:12am UTC](https://community.postman.com/t/is-there-anyway-to-check-status-code-with-if-else-condition-for-testing/36582 "2023-03-23T08:12:10Z")

</div>

How could I check status code 403 within a “if statement”? I want to make decision for test cases based on status code. For example: if status code is 403: DO this return(do not need to check the next condition) els…

---

## [How to use if else condition in postman visualizer](https://community.postman.com/t/how-to-use-if-else-condition-in-postman-visualizer/41526)

<div class="topic-metadata">

**Author:** [@science-specialist-3](https://community.postman.com/u/science-specialist-3)\
**Replies:** 0\
**Last updated:** [November 28, 2022, 2:36pm UTC](https://community.postman.com/t/how-to-use-if-else-condition-in-postman-visualizer/41526 "2022-11-28T14:36:25Z")

</div>

Hi All, Actually i want to write if else condition in my table data tag the condition is such that if key value is null or document don’t have key in the table it should show null. Here testOne and test are column i…

---

## [To assert that a string isn't blank or null then PASS the test else FAIL it](https://community.postman.com/t/to-assert-that-a-string-isnt-blank-or-null-then-pass-the-test-else-fail-it/36867)

<div class="topic-metadata">

**Author:** [@thingmie](https://community.postman.com/u/thingmie)\
**Replies:** 2\
**Last updated:** [July 5, 2022, 1:16pm UTC](https://community.postman.com/t/to-assert-that-a-string-isnt-blank-or-null-then-pass-the-test-else-fail-it/36867 "2022-07-05T13:16:35Z")

</div>

“Tokens": { “ZToken": "eyJ1c2VySWQiOiAiZmYxMzcyZ", “PToken": "uKnw7KiaSfueeAzG6nc6mvT" How can I construct a test to check whether each string isn’t blank or null (test PASS) else (test FAIL). Do I …

---

## [Using IF/ELSE in Postman Test scripts](https://community.postman.com/t/using-if-else-in-postman-test-scripts/32164)

<div class="topic-metadata">

**Author:** [@Denesh](https://community.postman.com/u/Denesh)\
**Replies:** 1\
**Last updated:** [February 2, 2022, 4:41pm UTC](https://community.postman.com/t/using-if-else-in-postman-test-scripts/32164 "2022-02-02T16:41:32Z")

</div>

I am using Postman in order to test, But I am stuck on using if/else in the scripts. My goal is to test if a property is visible in the response body. if the property is not there, I want postman to expect it be empty. …
