# Set column values not working as expected

**URL:** https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775
**Category:** Ask for Help
**Tags:** actions, custom-actions
**Created:** [November 9, 2024, 8:29am UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775 "2024-11-09T08:29:50Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![TechnicalMilk](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/technicalmilk/32/61177_2.png) [@TechnicalMilk](https://community.glideapps.com/u/TechnicalMilk)
#### Post date: [November 9, 2024, 8:29am UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775/1 "2024-11-09T08:29:50Z")

</div>

Hey all!  
I’m currently trying to make an edit screen where new lines appears when a certain button is pressed.  
Here is the custom action for it. every value has a boolean next to it. When it’s true, the next line is hidden, when its false the next line is visible. But every time I hit the button it just updates the very next row. After that i need to quit edit screen and get back again.

 ![problem1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/7/67fdc182dbae7ca59780e3ce422c1fe83b11653b.png)

---

<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: [November 9, 2024, 8:37am UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775/2 "2024-11-09T08:37:21Z")

</div>

What do you mean by “just updates the next row”?

So you are trying to add lines to a linked table, in an edit screen?

---

<div class="post-metadata">

### Author: ![TechnicalMilk](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/technicalmilk/32/61177_2.png) [@TechnicalMilk](https://community.glideapps.com/u/TechnicalMilk)
#### Post date: [November 9, 2024, 10:17am UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775/3 "2024-11-09T10:17:20Z")

</div>

Basically there are 2x6 rows in the screen (2x6 fields in a single row). But not all needed in all records so we will leave some of them empty. Therefore I need a button, when I need a new line to add it. It was added in the last version with visibility settings (if the row 2 isn’t empty it will reveal row 3 etc. ) but its not an elegant solution. There I wanted to customize a button for this. See pic attached

 ![problem2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/6/b6850c4fc982e601e14c5450506c0f117c21130a.png)

---

<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: [November 9, 2024, 12:02pm UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775/4 "2024-11-09T12:02:58Z")

</div>

So these are workouts in a single week, and you’re trying to add multiple rows for a week based on the number entries on the screen?

---

<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: [November 9, 2024, 2:51pm UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775/5 "2024-11-09T14:51:45Z")

</div>

I think I’m understanding what you are trying to do.

So to summarize, you have a form screen with several text entry components. You only want to show the first two components to begin with. Each time you click the button, the next two components are displayed.

To achieve this, you also have a boolean that is checked by default in the table for each set of columns. If this boolean is unchecked, the corresponding set of text entry component will display.

So based on your action flow, when you click the button it should clear the next boolean that is checked, correct?

> [@TechnicalMilk](#):
>
> But every time I hit the button it just updates the very next row. After that i need to quit edit screen and get back again

I’m still not sure I fully understanding what you mean by this either. Are you saying that when you click the button, the second set of components show on the screen, but clicking again does not cause the third set of components to display?

If that’s true, then I think the problem is because you are inside an edit form. I think your actions might be using the boolean values directly from the table row for each IF branch, but the set column action only updates the boolean value inside the form. Your IF branches are looking at a value that hasn’t been updated yet because you haven’t submitted the form. That’s why it only works when you have to submit the form each time after you click the button.

I think your best option is to not use an edit form at all. Instead use a New Screen so you can edit the values in real time and your action branches can look at those values from the table as they are updated.

---

<div class="post-metadata">

### Author: ![TechnicalMilk](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/technicalmilk/32/61177_2.png) [@TechnicalMilk](https://community.glideapps.com/u/TechnicalMilk)
#### Post date: [November 11, 2024, 6:24am UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775/6 "2024-11-11T06:24:28Z")

</div>

Yet only one question remained. When I open my new form from a different screen, how do I open the desired record I want to work on?

---

<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: [November 11, 2024, 8:02am UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775/7 "2024-11-11T08:02:38Z")

</div>

> [@TechnicalMilk](#):
>
> When I open my new form from a different screen

Now when you say form, do you mean you are using the ‘Show New Screen’ action? If you call that action from within the item you want to edit, and you specify ‘This Item’ in the action, then it will already be connected to the record to want to work on.

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [November 18, 2024, 8:03am UTC](https://community.glideapps.com/t/set-column-values-not-working-as-expected/77775/8 "2024-11-18T08:03:33Z")

</div>

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