Dropdown fields which gets data from database

I’m new to AppGyver, and really don’t have any programming knowledge.
I’m wanting to use drop down fields to grab information from the database.

I have created a data resource and can return results from a GET collection and GET record (using an id field).

a sample of the data is:
{"_id":"",“side_number”:“1”},
{"_id":"",“side_number”:“2”},

What steps do I now have to do to get the drop down to reference that collection (I’m wanting the side_number to show in the dropdown)?
side_number is set as a number

I’ve really gone round in circles to try and work this out.
I’ve added a data variable (setup as a collection of records) and page variable (set as text. I changed this to number to reflect what was in the database, but to no avail)

When I choose [Option List] and select either page variable and data variable I get incompatible. as per the screen captures below
For the data variable ,

For the page variable, I get

I also tried adding some flow logic. But, still no joy.

If anyone has a nice “how to” document/video to explain, that would be awesome.
Even some steps for guidance on what I should be doing would be awesome.

Thank you
Karen

Hi,

I created a small example to follow:

FIrst create atwo page variables, one is a list of objects and the other is a text type.

placesList is a list type of objects.

image

Each object has an id, and a name fields. Add some data such as below:

image

Then you need to update the two field of the Dropdown list as it is shown below:

For Options list, map it as the forumla below:

image

Then link Selected Value with page variable selectedPlace to assign the id to it.

All the best

Thank you for your quick response.

It wasn’t 100% what I was after, as I was wanting the drop down listing to come from the database.
Using the suggestion from yourself and looking at a couple of other forum articles, I’m certainly a lot closer that what I was.

What I did was, I added flow logic as per below

and I used the MAP forumla as
MAP(data.SelectionSides1,{label: item.side_number, value: item._id})

However, I’m getting a message of “List items are incompatible”

I’m assuming that my database fields should be called ‘name’ and ‘id’ instead of using the system _id field and side_number?
If not, how can I resolve the error.

Hi,

The label is a string while the assigned value is a number

image

Thank you Mazen.

I have now fixed that and everything is working correct.

Hey Hai Karen_Barton,

How do you fix these issues??

Please guide for us !!!

Hi Maddy_Madham

I made sue that my field names are completely unique, and as Mazen mentioned above, make sure that your label is text. For example
MAP(data.chooseFixtureInfo, {label:item.fixture_side, value:item.fixture_side}).

Is that what you are after?

Thank you Karen_Barton!!!

hey Barton,

Again Small Doubt??
How to set the dropdown list with the connection of multiple language

Please share some ideas

Hi Maddy_Madhan

To get a list of drop down values, use the MAP function. To get that list in multiple languages, I don’t know. You are probably best to ask the question in a separate post.

Karen