Primitives Question

Hi,

We’re new to AppGyver and so far we’re very happy to have spent some time investigating its potential. Looks like a great product.

We’ve put together a simple app:

  • Container with repeat data from a Firestore DB
  • Container has 2 x cells

One cell has the Property of Data Item in Repeat, the other cell a Primitives Checkbox. When we preview the app in a browser or using the Android app the Checkbox doesn’t function i.e. nothing happens when it’s clicked. We’ve tried switching the Checkbox for other Primitives and the Toggle also doesn’t work. The Dropdown and Slider do appear to function.

Are we doing something wrong or is this a bug?

Thanks.

Hi, welcome to the community! Glad to hear you’re enjoying trying out the product so far! What are you binding the Value property of the primitives to? If it’s bound to a true/false property of an item in the repeat, the two-way binding should work and the values change when the toggle or checkbox is clicked.

Hi,

Thanks very much for your reply. It doesn’t seem to matter what it’s bound to, it just doesn’t work when in a repeat data container. For instance, if we add a Primitives Checkbox within a repeat data container as mentioned above then:

  • Bind the Value property to a Page Variable
  • Attach a Toast component to the Component onChange event of the Checkbox
  • Set the Toast component to display the Output Value of the Checkbox

The Toast always displays “False” and the Checkbox doesn’t tick/untick.

When we repeat the above configuration outside of the repeat data container on the same page it works as expected.

Hi, when you are repeating items, I think the checkbox value can only be bound to a property of an item in the repeat for the two-way binding to work. An example can be seen in this tutorial, where “done” (true/false) properties of items in a to-do list are bound to checkboxes.

Hi, we’ve tried that too, we bound it to a boolean property of the data item in repeat. When we preview the app the GET works fine and the checkboxes have the correct value. But when we tap a checkbox it doesn’t change (tick or untick).

Did you find a solution for this? having the exact same problem. following a video guide. and the teacher seems to have no problems with this.
He just adds the primitive checkbox. and later on clicks it, with an toast that displays the value of component onChange. for him it flicks between true and flase

Hi,
Suppose we have a collection in firebase called users; each document has id, userId, and isAdmin.

Firebase

After setting up the firebase and creating a Data Resource called users

image

you need to add a container, a row, a paragraph, and a primitive checkbox as below:

image

image

Now, select the container and click the plus sign in below

image

Add a new property called content and link it to the paragraph content

Also, add a new property called isAdmin and set its properties as below:

Select teh checkbox and add the nodes in below:

image

Exit the Isolation mode

Add a new data variablecalled users1

Link the Repeat with field of the container to Users1

Then link Content field to current.userId and Checked to current.isAdmin

image

Add Trigger Event and set its Event Source to Fired from Trigger Event

Update record

Add Update Record node and set its resource name to Users

Then set its Identifier to current.id
image

and its Record to the formula in below

image

Now when you click the checkbox isAdmin field in firebase will be updated instantly.

All the best

Hi Adam,

No, I never found the solution and switched to using AWS as a backend. Hopefully the steps Mazen has kindly provided below will help you.