# Increment one line but some lines must not show

**URL:** https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128
**Category:** Ask for Help
**Created:** [July 26, 2020, 9:20pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128 "2020-07-26T21:20:10Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [July 26, 2020, 9:20pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/1 "2020-07-26T21:20:10Z")

</div>

Sheets challenge for me.

I would like to show a list of images - one image at a time - I was thinking of using the image component. Some of the images can be set to Hide, so they should not be shown. I would like to use an increment action so each time I click on a button the next image should be shown.

The increment action works nicely when all images are to be shown (using UID from below table) - but when some are not to be shown - and then the problem arises. I thought about doing an extra column (Value to use by the increment button) telling which is the next image to show - and do a relation lookout where only I get the row where Hide=No

How could this be solved - anyone?

| UID | Image id | Hide | Value to use by the increment button |
| --- | --- | --- | --- |
| 1 | image1 | Yes | 0 |
| 2 | image2 | No | 1 |
| 3 | image3 | Yes | 0 |
| 4 | image4 | No | 2 |
| 5 | image5 | No | 3 |

Using a similar setup as @Manan_Mehta did

> [@Paging and navigation using increment action](https://community.glideapps.com/t/paging-and-navigation-using-increment-action/10520):
>
> With the recently launched increment action, navigation between records becomes much simpler which previously required setting up plenty of relations to move around. How to do it?

---

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [July 26, 2020, 9:35pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/2 "2020-07-26T21:35:37Z")

</div>

@Jeff_Hager is this solvable, you think?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [July 26, 2020, 9:37pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/3 "2020-07-26T21:37:18Z")

</div>

Take another look at the link in this post and make a copy. I use a helper sheet with unique to get the list images without empty rows, then vlookups to get the determined columns used for a relation back to the original sheet. You could probably do something similar with a query in a helper sheet, some formula to get the row number, then a vlookup to get the row number back into the original sheet.

> [@Image carousel - limitation in number is images](https://community.glideapps.com/t/image-carousel-limitation-in-number-is-images/13110/3):
>
> Just curious on your use case for thousands of pictures in a carousel. That’s a lot of data for the app to cache at once. Would somebody be required to swipe thousands of times to see that last images? Would a structure similar to the memories tab here [https://rwtsk.glideapp.io/](https://rwtsk.glideapp.io/) be better?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [July 26, 2020, 10:01pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/4 "2020-07-26T22:01:37Z")

</div>

I will try to help Krivo with a sheet version of that idea when I get to the laptop later today.

I was working on something pretty similar but did not require an increment, but complex visibility based on each user and I hope I can share that with you guys as well soon.

---

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [July 26, 2020, 10:28pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/5 "2020-07-26T22:28:52Z")

</div>

@ThinhDinh that would be great.  
Tried to use @Jeff_Hager idea with a helper sheet - I didn’t get it to work as I wanted to get some variables which were only found in the builder. And is will also take a lot of rows ☹

I will stop for now as it is getting late (@ThinhDinh it is very late in Vietnam I believe 😴 ah - it might actually be morning 🙂 )

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [July 26, 2020, 10:33pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/6 "2020-07-26T22:33:56Z")

</div>

Ah it’s 5.30am man, just woke up. Have a good sleep and a great week 😊

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [July 26, 2020, 10:34pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/7 "2020-07-26T22:34:02Z")

</div>

> [@Krivo](#):
>
> And is will also take a lot of rows ☹

Just keep in mind that a helper sheet would not be used by glide, so it shouldn’t count against rows. It would only be used internally in the Google sheet.

---

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [July 26, 2020, 10:40pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/8 "2020-07-26T22:40:33Z")

</div>

@Jeff_Hager understood 👍

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [July 27, 2020, 8:54am UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/9 "2020-07-27T08:54:37Z")

</div>

Hi Krivo, here’s the sheet I worked on as promised.

> **[ThinhDinh's Glide Lab](https://docs.google.com/spreadsheets/d/1sEQHpSKyHx9w2F_Xx3lm56SU1p-8eI81OYU5TYvQFvw/edit#gid=1630449167)**
>
> Repeated sequence
> 
> User,Step,Order,Steps
> Ian Janicki,Consult,1,Consult
> Ian Janicki,Measure,2,Measure
> Ian Janicki,Materials Shipped,3,Materials Shipped
> Ian Janicki,Materials Arrived,4,Materials Arrived
> Ian Janicki,Renovation Complete,5,Renovation...

I used an arrayformula in cell C1 to only incrementally count the rows where the “Hide?” value is FALSE.

---

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [July 27, 2020, 8:49pm UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/10 "2020-07-27T20:49:25Z")

</div>

@ThinhDinh thx a lot. Looks great. I have one problem through. The “inactive” field is a simple text field until glide writes to the field whereafter it is a boolean field. If I make the whole column booleans then I will get all to many rows as glide will think it has values. So how to avoid that?  
Maybe I should change the formula so FALSE or empty string is found in the cell. But i’m not sure that the countifs will work then. Any hints/ideas?

(your formula)

> ={“Increment value”;ARRAYFORMULA(IF(B2:B\<\>“”,IF(B2:B=FALSE,COUNTIFS(B2:B,FALSE,ROW(B2:B),“\<=”&ROW(B2:B)),0),“”))}

`

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [July 28, 2020, 1:26am UTC](https://community.glideapps.com/t/increment-one-line-but-some-lines-must-not-show/13128/11 "2020-07-28T01:26:43Z")

</div>

I think you can keep the old flow and make sure these things are done:

- Remove all the empty rows.
- Go to Data \> Data validation, choose the range to be B2:B (in my case it’s column B), choose checkbox.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/3/36595cebd05854e7e8f2852b5008822af955b251.png)

When you add a new row, it will honour the checkbox settings and its default value is now a FALSE (as in to be shown in your case).

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/d/d5b7d1d7b5f69ea94cb36d28e9667cc58e399784.png)
