Data variable linked to Input fields in 2nd level of hidden fields disappears (possible bug?)

Hi,

Posting here in case someone might run into a similar problem.

In my database I have a field called data.Localdatabase.costPrice I have linked it to an Input field, which is located inside a Cell#1, located inside row called “Cost price”.

There are formula that decides Visiblity of" Cost Price" row and also Visibility of Input Field (so 2 levels)

image

When the app starts both fields are hidden as per logic in place, but what happens is that the downloaded record assigned to Input field - data.Localdatabase.costPrice - disappears. I disapears both on the screen (when you make the fields visible later) but also in the underlying data as seen in the debugger.

So hidden Input field inside another hidden field - “deletes” the assigned value.

If this is just a single hidden Input field inside without any components level above that are - it all works fine.

I have changed it to remote the nesting and it seems to be working fine.

Nope, I think the reason is different. If I assign variable to an Input field and make the visibility depending on if the variable IS_EMPTY() the variable becomes empty… Is this a bug?
image

This sounds weird, and I haven’t encountered this (and I use !IS_EMPTY a lot in visibility stuff)…… So have you checked that if you take away this visibility setting the variable is not empty? The IS_EMPTY formula does not modify the original data at all.

I have created a simple app that ilustrates what is happening (app number 237197):
First page:

The database has property1 - any text and property2 number. The input fields will allow you to create some data - we need basically 2 entries:

  • property1 = test1 and property2=5 (basically both fields with some data entered)
  • property2 =test2 and property2 - no data entered

Now the list should generate after 5 second list of both entries .

Clicking on the list it will take you to a view detail page where:
image

Input field Parameter2 (which shows LocalDatabase1.property2) has the following visibility setting:
NOT(IS_EMPTY(data.LocalDatabase1.property2))

In case of test1 you should see Parameter1 and value of property2. In case of test2 you should not see input box Parameter2 and value of property2.

In my testing using a formula like above the Parameter2 input box is never showing up. The formula always evaluates to false.

Let me know if you are able to replicate this error?

Hi, I was able to repro this bug. It really is a weird one… I’ll put this to our backlog to be fixed. It seems that if you use the same data variable as an input and as a visibility condition, the visibility Formula will evaluate incorrectly.

I tried to find a way for you to go around the issue and I think I found one. Try using a Formula with just data.LocalDatabase1.property2 as visibility condition. The editor will complain that it isn’t assignable to true/false, but it’ll still work. Or at least in my repro it is was possible to use it like that. Let me know if this doesn’t suit for you or if it doesn’t work in your real app.

Or, you could use the record as page or app variables if that feels suitable.

Hi @Tomi_Laakso,

I have actually found a workaround already (without using the variable itself as a visibility trigger). I just built this to reproduce the isusse as this is a very weird bug indeed…

@Tomi_Laakso

If you think above was a weird bug… check out this one. This is an application where I replicated what is happening in my main app:
https://platform.appgyver.com/builder/applications/145477/pages/1

There are 3 Containers on the page:
Step 1,
Step 2,
Step 3

Clicking on buttons moves you to next (or previous) stage and hides the previous stage. This error might be also linked with visibility issue.

It used to work and still works on the published app, but now on the preview app it is violently crashing the app (exists to home screen)

Pressing the icon button crashes the app.


Pressing the regular button with exactly the same logic does not crash the app.
Pressing the icon button without the preceding if the module does not crash the app.
Pressing the icon button when the parent container has visibility setting true also does not crash the app.

I found out what is causing the issue really by trial and error connectin and disconnecting different elements. It would be helpful to have some crash reports. Sometimes the app crashes really without showing anything in the debugger (as it just shuts off) like e.g. in case of the dropdown component (if feed with “undefined” values,but that’s separate issue).

I tested this app, but did not have any crash on pressing the icon button (either with web or iOS, using 1.9.15). Are you still experiencing the crash? How can I reproduce it? I pressed the first repeated list item and then pressed the icon button.

Hi,

I just sent you a video showing the details of the crash. I am using Android preview app updated to 1.9.15.

it used to work in the past. BTW I have also tried crearing cash and clearing storage data in the app, so that I need to log in again.

I checked out your video and tested this out on Android and indeed, while it doesn’t crash on iOS/Web, it does crash on Android :thinking:

The good news is that this doesn’t crash anymore with the beta client (2.2.0), so whatever problem there was, has been fixed with the new client update. If you can wait until 2.X is out, I recommend doing so, but if you can’t, I can try if I can figure out a workaround for you.

I have replaced it with a regular button and that works fine. I just wanted to let you know in case there is something that can be done.

Looking forward to 2.2.0

1 Like