How to display an array from Firebase Rest API onto a toggle list

Hi all,

I am not a techy and trying out AppGyver for the first time. I am having a few issues and have had no lucky in finding a solution hence creating this topic.

I have a firebase database which is connected to my appgyver as a data source. I have setup the GET collection method and the test was successful. I also set the schema.

My data structure is as follows:

-Collection

  • Document
    • Field 1
    • FIeld 2
    • FIeld 3
    • Field 4
      • Value 1
      • Value 2
    • Field 5

So as you can see I have a field that has an array stored as the values.

What I want to do is, I want to display the array values (values of field 4) on to a toggle list on repeat - so the toggle list will populate a new line for each array item.
So when I try to repeat and bind using data variable it showsthat field as incompatible.

Please help me out on this issue. Let me know if there is another way to display this list if not for the toggle list.

This sounds like your Field 4 is a List of Texts. To be able to repeat Lists as visible components, the repeated value has to be a List of Objects instead.

You can transform you List of Texts into List of Objects by using MAP Formula function. It should look something like this:

MAP(data.field4, {newKey: item})

You’d need to put this Formula into Repeat with property of the toggle component. If this doesn’t solve your issue, take a couple of screenshots of your data schema and let’s look at the issue again.