# For each item j all must qualify

**URL:** https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768
**Category:** Questions about Thunkable X
**Tags:** list
**Created:** [January 1, 2022, 4:23pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768 "2022-01-01T16:23:31Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)
#### Post date: [January 1, 2022, 4:23pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/1 "2022-01-01T16:23:31Z")

</div>

I have the following, but I want ALL text inputs, which don’t contain the word “optional” in the hint, to be required to have something in the field.

Currently, a user could just enter the Last Name field and it will allow them to pass to the next page.

I understand the j loops through & when it gets the last input and it has text, then it qualifies the block requirements.  
Am I missing a simple solution to requiring ALL which don’t have “optional” instead of just the last one?

I don’t want to do a count variable because then it would be required to be 2/3. I’d rather just ALL that aren’t optional must have some text.

Thanks again

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/0/d0f83742e830abe06dc240bb508f4f166d808c2c.png)

---

<div class="post-metadata">

### Author: ![sketch](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sketch/32/109058_2.png) [@sketch](https://community.thunkable.com/u/sketch)
#### Post date: [January 1, 2022, 4:52pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/2 "2022-01-01T16:52:38Z")

</div>

Could you share the full image of the blocks?  
Would make it a little bit easier to see whats wrong.

Thanks

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 1, 2022, 4:56pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/3 "2022-01-01T16:56:39Z")

</div>

You’re checking for the text input to be non-empty (not equal to “”). Instead, set a variable value to false before the loop starts and then check for the text input to be empty (=“”). If you find it’s empty, change the variable to true. Once the loop completes, if the variable is still false, the form is completed.

---

<div class="post-metadata">

### Author: ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)
#### Post date: [January 1, 2022, 7:26pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/4 "2022-01-01T19:26:25Z")

</div>

So for the first loop it checks if the First Name is empty  
if yes, then keep variable false

Next loop does input contain (optional)  
if yes, skips

Third loop, is input empty,  
if no, change variable to true.

True would now allow the user to pass to the next screen even though the First Name was blank

---

<div class="post-metadata">

### Author: ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)
#### Post date: [January 1, 2022, 7:32pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/5 "2022-01-01T19:32:50Z")

</div>

I solved it with a break out of loop block

This forces if something is in fact blank, it just quits the operation entirely and prevents access to the next page from the user.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/f/bf9254e7d2a056d131b844b63cd419eabc40e1ec.png)

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 1, 2022, 8:42pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/6 "2022-01-01T20:42:24Z")

</div>

> So for the first loop it checks if the First Name is empty  
> if yes, then keep variable false

This is not what I said. If the input is empty, you change the variable to true. If it’s not empty, you ignore it.

Your variable can be called something like “found empty input”.

---

<div class="post-metadata">

### Author: ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)
#### Post date: [January 1, 2022, 8:47pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/7 "2022-01-01T20:47:31Z")

</div>

I see sorry, so it’s effectively the same thing as the break out block but without the variable. Sorry again for my misunderstanding

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 1, 2022, 9:01pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/8 "2022-01-01T21:01:52Z")

</div>

That’s okay, I’m glad you got it working with a break out block.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [April 1, 2022, 9:02pm UTC](https://community.thunkable.com/t/for-each-item-j-all-must-qualify/1663768/9 "2022-04-01T21:02:09Z")

</div>

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