# How to write only 2 row

**URL:** https://community.glideapps.com/t/how-to-write-only-2-row/79948
**Category:** Ask for Help
**Created:** [February 10, 2025, 9:16am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948 "2025-02-10T09:16:29Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Smarthome\_Support](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/smarthome_support/32/84553_2.png) [@Smarthome\_Support](https://community.glideapps.com/u/Smarthome_Support)
#### Post date: [February 10, 2025, 9:16am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/1 "2025-02-10T09:16:29Z")

</div>

I want the button disappear after write the 2 row and I have try many way but not work

---

<div class="post-metadata">

### Author: ![Smarthome\_Support](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/smarthome_support/32/84553_2.png) [@Smarthome\_Support](https://community.glideapps.com/u/Smarthome_Support)
#### Post date: [February 10, 2025, 9:19am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/2 "2025-02-10T09:19:29Z")

</div>

Just like when choose 2 data and can’t choose more than 2

 ![สกรีนช็อต 2025-02-10 161819](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/a/ea9b35300866848a6f0ab246eeb7661637a6d4be.png)  
 ![สกรีนช็อต 2025-02-10 161830](https://us1.discourse-cdn.com/flex002/uploads/glideapps/optimized/3X/0/9/090c35a9bd87b69402904c6ae05415e690b145e4_2_690x29.png)  
 ![สกรีนช็อต 2025-02-10 161839](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/c/9cf8be0be833f2f4f4c676784c7e6951d36ee25a.png)

---

<div class="post-metadata">

### Author: ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)
#### Post date: [February 10, 2025, 11:53am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/3 "2025-02-10T11:53:54Z")

</div>

If you mean, hide a button when 2 specific rows are edited:

1. You could use a query column to filter the 2 rows based on your requirements.
2. Then add a lookup column to the query column row id (or any other column that is NEVER empty).
3. Add an array length column and choose the lookup column as the source.
4. Add a visibility condition on the button to check if the array length is 0 (or not zero based on the conditions you put in the query column).

Edit: I think I understand that you want to show a compare screen with only two products. So the condition to hide the button would be:  
If array length is less than 2.

Edit 2: I didn’t think about that, but Jeff is right. Rollup is the way to go:

> [@How to write only 2 row](https://community.glideapps.com/t/how-to-write-only-2-row/79948/4):
>
> These could both be replaced with a single Rollup column.

Here is the new procedure:

1. You could use a query column to filter the 2 rows based on your requirements.
2. Then add a rollup column to the query column row id (or any other column that is NEVER empty) and choose count.
3. Add a visibility condition on the button to check if the rollup value is 0 (or not zero based on the conditions you put in the query column).

---

<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: [February 10, 2025, 1:07pm UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/4 "2025-02-10T13:07:47Z")

</div>

> [@MaximeBaker](#):
>
> 1. Then add a lookup column to the query column row id (or any other column that is NEVER empty).
> 2. Add an array length column and choose the lookup column as the source.

These could both be replaced with a single Rollup column.

---

<div class="post-metadata">

### Author: ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)
#### Post date: [February 10, 2025, 1:14pm UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/5 "2025-02-10T13:14:26Z")

</div>

Oh well, I didn’t think about that one ! LOL

---

<div class="post-metadata">

### Author: ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)
#### Post date: [February 10, 2025, 1:16pm UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/6 "2025-02-10T13:16:34Z")

</div>

> [@MaximeBaker](#):
>
> Here is the new procedure:
> 
> 1. You could use a query column to filter the 2 rows based on your requirements.
> 2. Then add a rollup column to the query column row id (or any other column that is NEVER empty) and choose count.
> 3. Add a visibility condition on the button to check if the rollup value is 0 (or not zero based on the conditions you put in the query column).

@Smarthome_Support Here you go!

---

<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: [February 10, 2025, 11:25pm UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/7 "2025-02-10T23:25:12Z")

</div>

@Smarthome_Support What does your Compare button do? A set values action?

---

<div class="post-metadata">

### Author: ![Smarthome\_Support](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/smarthome_support/32/84553_2.png) [@Smarthome\_Support](https://community.glideapps.com/u/Smarthome_Support)
#### Post date: [February 11, 2025, 2:11am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/8 "2025-02-11T02:11:29Z")

</div>

no, that’s add row not set the value

---

<div class="post-metadata">

### Author: ![Smarthome\_Support](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/smarthome_support/32/84553_2.png) [@Smarthome\_Support](https://community.glideapps.com/u/Smarthome_Support)
#### Post date: [February 11, 2025, 2:23am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/9 "2025-02-11T02:23:58Z")

</div>

I have try but not work. Could you show a sample?

---

<div class="post-metadata">

### Author: ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)
#### Post date: [February 12, 2025, 2:33am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/10 "2025-02-12T02:33:28Z")

</div>

Could you show me your case so I can make a sample closed to your use case?

---

<div class="post-metadata">

### Author: ![Smarthome\_Support](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/smarthome_support/32/84553_2.png) [@Smarthome\_Support](https://community.glideapps.com/u/Smarthome_Support)
#### Post date: [February 13, 2025, 6:42am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/11 "2025-02-13T06:42:12Z")

</div>

My case is give customer a help to search the product from customer select, and it will show the result from data sheet, after that if customer want to know the different, they can click the compare button for add row to other table and see the different. but my problem is the compare button have to hide after choose 2 product, but it’s not work or I’m wrong in some place.

---

<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: [February 13, 2025, 11:24pm UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/12 "2025-02-13T23:24:35Z")

</div>

- Add a user-specific column boolean to your Items table.
- Your “compare” button would write a true value to that column.
- Add a custom collection with two items side-by-side like you already have, filter for items that have the “Chosen” boolean checked.
- Add a remove button to that custom collection, clearing the value in “Chosen”.
- In your User Profiles table, add a rollup on top of the “Chosen” boolean. If the rollup is greater than or equal to 2, hide the “Compare” button.

---

<div class="post-metadata">

### Author: ![Smarthome\_Support](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/smarthome_support/32/84553_2.png) [@Smarthome\_Support](https://community.glideapps.com/u/Smarthome_Support)
#### Post date: [February 14, 2025, 4:15am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/13 "2025-02-14T04:15:59Z")

</div>

It’s work now, thank you. but how to set the all boolean in to false in one button after compare complete such as click clear to set all boolean to default.

---

<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: [February 14, 2025, 4:29am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/14 "2025-02-14T04:29:49Z")

</div>

Considering you would only have at most 2 at a time:

- In your Users table, create a query to the Items table, filter by “Chosen” is checked.
- Add a single value column, get the first whole row from the query above.
- Add another single value column, get the from start \> 1 whole row from the query above.
- Your “Clear” button will have 2 set column values actions, using two single value columns above, clearing the “Chosen” column.

---

<div class="post-metadata">

### Author: ![Smarthome\_Support](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/smarthome_support/32/84553_2.png) [@Smarthome\_Support](https://community.glideapps.com/u/Smarthome_Support)
#### Post date: [February 14, 2025, 8:12am UTC](https://community.glideapps.com/t/how-to-write-only-2-row/79948/15 "2025-02-14T08:12:44Z")

</div>

That’s awesome, Thank you
