List Item from database

Can you define what item is shown in a list item. Like find specific columns in my database with repeated data but only show values from specific group.

In my database, I have made a column were you identify groups, let’s say A, B C or Trees, Flowers etc. Can I use a formula to repeat data from this column but only data that is identified as, let’s say, Group A or Group Trees?

Untitled

I then want the list item to show information from other cells from that particular row and then put them in Alphabetic order.

Yes, this is possible. I think SELECT_BY_KEY will help you with repeating only items from specific group, e.g. something like this:

SELECT_BY_KEY(data.all_data, "group", "A")

And alphabetical order should be possible with SORT_BY_KEY.

Thank you Tomi, I have tried every option now but I still cant get it to work.
What I am doing, this might be wrong, is that I have put that formula into the “repeat with” option.

I have put SELECT_BY_KEY(data.Browseposter1, "Trees AZ, “A”), I have tried many versions of this, but I can get it to work. I have the same problem when using the SORT_BY_KEY, not sure what I am doing wrong.

I think it should be like that, but it could be that I don’t understand your issue correctly. Could you write a more specific example of your use case?

Cause now your image with example data has two “A” values in column 1 and two of each “tags” on column 2. It’s not clear to me what you want to show on a page and which column defines that as you talk about “A, B, C or Trees, Flowers etc.” when those are in different data columns.

Hi Tomi, Thank you.

I am trying to build a Plant Identification app that amongst other functions have this functions: an A-Z page with buttons for each letter of the alphabet.q

When you press the button you are taken to the next page, a list item page. Depending on your choice of letter, the list item will display only the plants starting with that letter, with information from other columns, like the name of the plant, latin name of the plant and a picture.

3

We would also like to groups the plant into for example “Trees”, “Flowers” and “Grasses”.
2
The plant can belong to more that one groups, as in the picture, but it should work the same way as when choosing a letter so you press a button called “Trees” and is then taken to the list item page displaying plants belonging to that group.

Thanks again for your help.

Okay, sounds clear. I’d still need to know what your data model/schema looks like to really give a clear answer here.

Thanks Tomi, How can I show you that information? Do you need my Id?

Nope, you just need to tell me what does the Data/Page/App variable look like in Composer. Just take s screenshot of it with fields opened and I’ll be able to tell how to write the Formula

Thanks Tomi,

Pictures from the list item data variable.

Ah, I’d need a screenshot from the Data resource tab so that I can see all properties of that Data resource. Now I cannot say which property I should find/select with Formulas as I don’t know what fields it has.

Also as I remember that you have a complex schema it would be good if you could highlight in the screenshot which of the properties is the “Letter” (a, b, c, etc.) and which is the plant type (“Trees”, “Flower”, “Grasses”)

Trying again, hope this is what you need

Now we’re talking :+1:

So you need two different Formulas here, one for finding based on Trees AZ (letters) and one for Hoofstock Trees (plant types).

(Sidenote: When you create data resources next time it would be wise to have no spaces in their name, because in some cases those can be problematic. For example the names you now use could be treesAZ and hoofstockTrees or trees_AZ and hoofstock_trees.)

To find all plants with “A” or “a” in Trees AZ, you’d use Formula something like this:

SELECT(data.Browseposter, LOWERCASE(item.fields["Trees AZ"]) == "a")

Then you need to replace the "a" with the variable that includes the letter of choice.

To find all plant that have plat type “Trees” in their Hoofstock Trees List, you’d use this type of Formula:

SELECT(data.Browseposter, IS_IN_ARRAY(item.fields["Hoofstock Trees"], "Trees"))

And again, you need to replace “Trees” with the variable that includes the selected value.

Thank you Tomi,

Those formulas have helped me so much and I have set up several list items now.

I have also followed your advice and renamed all the data resources so they don’t have any spaces in their name.

The only thing I can’t do in the list item is get the data in alphabetic order. I am using the SORT_BY_KEY function but the formulas doesn’t like it when I add this information to them. I have tried writing the formula in all labels and the repeat box.

Try ORDER for alphabetical order

Thank you Tomi and John,

I have tried both ORDER and SORT_BY_KEY, I am not sure how to wrap this round my formulas.
This is what I have at the moment:

SORT_BY_KEY(SELECT(data.Browseposter1, UPPERCASE(item.fields[params.parameterGroup]) == params.parameterAZ), “asc”),

Tomi, I am also taking it a step further now and build on the first formula.
As an example, I want to first select items from column “Hoofstock Trees” that belongs to Group “Trees”. Then based on this result, I then want to be able to narrow the “list item” further down by including items that also belong to Group “Flowers” as in the picture above.
Then, based on this “Item list” I want to narrow the search down but this time showing only items that belong to Groups “Trees”, “Flowers” and from Column “Trees AZ” Groups A.

I have been playing around with GROUP, REDUSE and FILTER SELECT, but not getting a result, I don’t know if it is even possible. As always your help is priceless and much, much appreciated.

This can be solved best with SELECT I think. Soething like this:

SELECT(data.Browserposter1, IS_IN_ARRAY(item.HoofstockTrees, "Trees") && IS_IN_ARRAY(item.HoofstockTrees, "Flowers") && LOWERCASE(item.TreesAZ) == "a"))

Finding the right Formula is mostly about just testing and a good way to do that is to start with a simple one and when that works, make the Formula more complex by adding one condition at a time.

Your SORT_BY_KEY seems to be missing one parameter (if asc isn’t that key by chhange)

Thank you Tomi, appreciate you taking the time to answer my many questions.

This has given me lots to play around with and hopefully also very useful for others, since my question was highlighted in your latest e-mail update.

It is good to know or just find out, if you are even on the right track, especially if you have no experience in coding or been struggling with a problem for a long time.

The SORT_BY_KEY is something I have been trying to understand for over 3 weeks, I have left it for now, as I have not been able to crack it yet even using the simplest of formulas.

1 Like

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)