Disappearing number input when using conditional visibility

The Bug

I have a weird and kind of hard to reproduce bug where form inputs disappear while using the app without any changes to the sheet.

The app always starts out working and I’ve never been able to reproduce it in the web editor but after a while, the form stops working. My hunch is that it only happens after the display goes to sleep or the app goes into the background. Force closing the app always fixes the problem and the form input appears again on a fresh start.

It should look like the form on the right (and often does) but fairly frequently it looks like the form on the left (without any changes to the sheet)


I have a Single Value column that is used to control the visibility of two “Number Entry” fields in a form.

The idea is that the Single Value toggle chooses which of the input gets visible.

Any ideas what could be causing this? Is this a bug in Glide or in my app setup? My app’s url is: lyftingar.glideapp.io

I don’t see that visibility condition in your app. Did you remove it? Could you maybe make a copy of your app in the state where it shows the error so that I can investigate?

Is the single value column toggle part of the form? If so, it is making the form input dissappear without affecting the google sheet. This is a bug that has been mentioned before. Any form input which is used as conditional visibility condition makes the thing dissappear without affecting the google sheet data.

@Mark the visibility condition is still in the app. There is a menu tab called settings, that flicks the Single Value column on and off. Then there is a form button on the details page for each exercise that displays a form that uses the Single Value column to choose which input to display.

The weird thing is that a lot of other data is using the Single Value column and it all works well. Only the form inputs seem to flake out.

I reproduced the bug yesterday and looked at the spreadsheet and all the values seemed normal so I’m not sure I can copy the app in a certain state. It seems that the state goes haywire while running the app. Also because I have two inputs, one that should be visible when the value is TRUE and another when it is FALSE, and neither is showing it seems like the value is neither TRUE nor FALSE.

@vijay The single value toggle is not part of the form and I don’t turn that toggle on or off at all during normal execution of the app. However, there is a form in the Settings tab that can toggle it on and off, but it’s not the same form as the one that glitches out.

@johannth Next time you see the bug, would you mind looking at the spreadsheet to check what the value in Settings sheet is? If it’s empty, then neither condition will work, because one of them checks TRUE, and the other checks FALSE. You could change the latter to say is not TRUE.

I actually think I can reproduce it.

  1. Open the app, navigate to a details screen of an exercise.
  2. Press the Log Exercise button to open the form and note that the form has the Weight (lbs) input.
  3. Wait until the iOS OS takes the app to sleep (screen goes off).
  4. Open the app again
  5. Press the Log Exercise button and notice that the Weight input has disappeared

I just had it happen, checked the spreadsheet and the value is FALSE


In the data editor:

Is it possible that you have the screen filtered so it’s not pointing to a row in the sheet? Maybe it’s greyed out because there is no row to update.

Ok, I can reproduce it now. Will investigate.

1 Like

@johannth If you happen to find an easier way to reproduce this I’d be much obliged.

Thanks, that worked.

1 Like

I’ll keep investigating. Thanks for having a look.

@Jeff_Hager The input with the conditional visibility is in a form that creates a new row so I guess it technically isn’t pointing to a row in the sheet. But it uses the Single Value from the row that owns the Detail View.

Something like this:

Row 1 in spreadsheet sheet A that has Single Value = False
-> Navigate to detail view of Row 1
-> Press form button
-> Form uses Single Value from Row 1 to show or hide the inputs
-> Submitting form creates a new row in Sheet B

This all works until the screen is put to sleep by the OS, then it seems that the form is reading the Single Value as null or something.

I’m actually unable to reproduce it now through the same method I could reliably do it earlier today. So, maybe it is fixed? :smiley:

We didn’t deploy anything that looks like it could have fixed it. It might just be a very odd to reproduce bug.

@johannth Have you seen this bug again?

I made the change you suggested and changed the visibility to IS NOT TRUE. Then the Lbs input never disappears (which makes my app more usable while here in US).

On a fresh install, everything works as expected. However, for curiosity sake, I let the OS take the app to sleep (3 mins), tried going into the Settings Tab, flicking the Default unit is Kilogram toggle on, go back to the form then I still see the Lbs input, not the Kg input as expected. So it seems that the the run-time app loses track of the Single Value and it is probably Null at this point. I tried this again after force closing the app and then toggling work and I always got the correct input.

At the same time I opened up the data editor on Web and the value updates in real-time there when I flick the toggle in Settings, suggesting that the sheet gets updated correctly.

Then I tried reproducing it again and it didn’t happen. flips table. So, a difficult bug, haha

So the bug seems to be still here, and reproduces sporadically after the app goes to sleep, never on fresh open. However, the IS NOT TRUE hacks works so this isn’t really a problem for me until I go back to Iceland. And then I can change the visibility condition again, haha.

I created a much more simpler app that might make it a bit easier to debug the bug: o5oeq.glideapp.io

It has the same general structure but removes all the extra data. I’ve been managing to reproduce it by setting iOS sleep to 30 seconds and having the OS put the app to sleep.

It seems that the Single Value is empty when it goes haywire, as it hides inputs that check for Is TRUE and Is False but shows test on Is Empty.

Hope it helps.

I think we have a fix for this. It should deploy tomorrow. I’ll let you know and will ask you to test.

@johannth Would you mind checking whether you can still reproduce this, please?