Display records into different category

Display records into different category

  

Hi all,

I have a huge data with different categories.

In my preparation, i use foreach to group them into their own category into a list (listAppend).

As i want to limit 3 records in each category, i find myself difficult to use the list navigation.

Below is the illustration what i plan to do. (Assume that there are 9 fruits and 12 Colours)

So when user click on the next button, the fruit and colour categories will change to the next 3 records. As for the colour category, since it have 12 colours, for the last page, the fruit category should not appear and it will just show the last 3 records of the colour.

Thank for the help in advance.

Hi XL,

First, you mention a For Each for creating the lists. This is possible of course, but if you use Platform 10 you could check out the ListFilter System action, which might be of help. ListFilter allows you to filter a list based on a condition.

Secondly, if I understand correctly, you want multiple Table Records (or List Records) that use a single navigation control. Allow me to say that I think that might be a bad userinterface design, especially as it seems the categories themselves don't have a connection (so that the three fruit types apple/watermelon/guava have no link or connection to the colours red/blue/green). Technically though, I think it's not much different to have a single Table Records use navigation or multiple. Have you tried to first create the navigation with a single category?

Hi Kilian,

Thanks for the reply.

Yes, i did try to create the navigation with a single category.

May i ask what will be a good user interface design? 

I have a huge data and i want to display it to the user based on the category so that it is to search.

Technically though, I think it's not much different to have a single Table Records use navigation or multiple. -> may i know what you mean?


thanks

Hi XL,

I think you should have every Category data navigation separate. Just like Kilion mentioned that the Categories dont have any connections.

Something like below can be done.


Shashank...

The full image didn't come through last time.

Shashank...

I have created a small eSpace that shows navigating more than one Table Records at once. However, again, that might not be the best user experience.

Hi Shashank,

I have thought of this too, but it doesn't look nice which is why i am asking for advice if there is any way i can do?

Hi Kilian,

I understand that it might not be the best user experience, do you have any better ideas how i can do it??

Kilian Hekhuis wrote:

I have created a small eSpace that shows navigating more than one Table Records at once. However, again, that might not be the best user experience.

Hi Kilian,

Really appreciate your help on the example for multi navigation, but i try to execute your multinavigation and it show me error.

Nevertheless, i try on my side but it doesn't work properly.


Hi XL Jace,

I make changes in oml that provide by Kilian Hekhuis and got expected output.

Follow the process

1. Create two table(Fruit & Color) and fill data into them

2. Set property of TableFruit table

Line Count: 3

Start Index: 

List_Navigation_GetStartIndex(If(TableFruit.List.Length>TableColor.List.Length,TableFruit.Id,TableColor.Id))

3. Set property of TableColor table

Line Count: 3

Start Index: 

List_Navigation_GetStartIndex(If(TableFruit.List.Length>TableColor.List.Length,TableFruit.Id,TableColor.Id))

3. Add list_navigation and set property as

 ListWidgetId:  

If(TableFruit.List.Length>TableColor.List.Length,TableFruit.Id,TableColor.Id)

LineCount:

If(TableFruit.List.Length>TableColor.List.Length,TableFruit.LineCount,TableColor.LineCount)

TotalRowCount:

If(TableFruit.List.Length>TableColor.List.Length,TableFruit.List.Length,TableColor.List.Length)


4. Destination: Add new screen action and refresh both tables



And the final output is


when you are in first page

when you are in last page


Let me know :)



Hi Gopal,

Thank you for the detailed explanation. I will give it a try. May i ask if this work if i have more than 2 categories?

Hi XL Jace,

No, this option will not work. But you can do this by making some changes into this.

We need to find witch category have more items. We can find it on preparation. then create some veriables

like,

for list navigation:

 WidgetId(text), LineCount(integer), TotalRowCount(integer), 

for tables:

StartIndex(integer), LineCountForTable(integer).


assign proper value into this variables and use this variable for table & list navigation property.


Hi Gopal,

Noted, i will give it a try.

Because currently i have five categories, thatwise i am thinking how to use the solution you give. 

Is there any other alternatives i can workaround which is less complicated?

Hi jace,

I make some changes on this code and working good, Now you can add categories more than 2.

1) Add 3 local variable

       WidgetId(text), 

       LineCount(integer), 

      TotalRowCount(integer)


2) In preparation add values into this variable, compare and find category who have more item and assign that category values to the variable, in this case color category have more record. 



3) Set startIndex of all table to 

List_Navigation_GetStartIndex(WidgetId)



4)Add property of list navigation as following

And here we go ;)



Hi Gopal,

Really really appreciated your help.. :') Really a great help for the community and people who have the same questions as me.

Pardon me. I got a few questions. 

2) In preparation add values into this variable, compare and find category who have more item and assign that category values to the variable, in this case color category have more record.

->As mentioned, currently In my preparation, i use foreach to group them into their own category into a list (listAppend). Meaning that i would be able to know how many items are in each category. So the headache part is how to compare which categories (5 categories) have the most items?

Another question is if there are no items,can i hide the table??


thank thanks

Hello XL.

Can I propose something a little bit different?

Something like this: https://eduardojauch.outsystemscloud.com/CategoriesAndItemsSameTable/Home.aspx?_ts=636404844981396993

First page:


Second page:

The idea is to use a single Aggregate/List Records. :)

Cheers,
Eduardo Jauch

Just an observation.

The "(Showing..." information is not completely correct and is not efficiently handed in this example and is not simple of get.

To a better experience, should be add an attribute to the "item" entity to hold its "position", that should be a sequential number per category (what requires the fix of numbers when a an item is deactivated/deleted). With this number, is very easy to display this kind of information.

Cheers,
Eduardo Jauch

Finds records based on the context of a specified field, letting you create scripts that behave similarly to using the shortcut menu in Table View.If you do not specify a field, FileMaker Pro searches based on the contents of the field that is active when the script runs. If data is selected in the active field, FileMaker Pro searches for the selected data. If data is not selected, FileMaker Pro searches for the entire contents of the active field. If you do not specify a field and there is no active field when the script runs, FileMaker Pro displays an invalid command alert.Find Matching Records runs in Browse or Preview modes. If the database is in another mode when the script runs, FileMaker Pro switches to Browse mode before running the script.Find Matching Records can be copied and pasted or imported into other FileMaker Pro files. vashikaran

Hi Eduardo Jauch,

Sure, thanks for the alternative solution. i will give it a try too.

May i find out how come you join the item two times in the aggregate function??

Hello, Jace,

You can add the same entity multiple times, using the Add Source link in the Sources tab of the aggregate. You can also change the names of entities inside the aggregate, to allow you to reference them by a more meaningful name, according the use of the entity in the aggregate.

Cheers,

Eduardo Jauch

Eduardo Jauch wrote:

Hello, Jace,

You can add the same entity multiple times, using the Add Source link in the Sources tab of the aggregate. You can also change the names of entities inside the aggregate, to allow you to reference them by a more meaningful name, according the use of the entity in the aggregate.

Cheers,

Eduardo Jauch

Hi,

Noted.. Thanks. I want to display it in table records thus need some time to figure out how to incorporate into the solution you give.


Jace Jace wrote:

Hi,

Noted.. Thanks. I want to display it in table records thus need some time to figure out how to incorporate into the solution you give.

Hello Jace,

There is any requirement to use a TableRecords instead of a ListRecords, beside the style?
You can apply style to make the ListRecords to be similar to TableRecords.

It is possible to apply a style to make the ListRecords looks exactly the same as a TableRecords.

In any case, with this kind of arrangement, it is a lot easier to use a ListRecord and style it, than to use a TableRecord, that already have a defined style.

Cheers,
Eduardo Jauch


Eduardo Jauch wrote:

Jace Jace wrote:

Hi,

Noted.. Thanks. I want to display it in table records thus need some time to figure out how to incorporate into the solution you give.

Hello Jace,

There is any requirement to use a TableRecords instead of a ListRecords, beside the style?
You can apply style to make the ListRecords to be similar to TableRecords.

It is possible to apply a style to make the ListRecords looks exactly the same as a TableRecords.

In any case, with this kind of arrangement, it is a lot easier to use a ListRecord and style it, than to use a TableRecord, that already have a defined style.

Cheers,
Eduardo Jauch


Hi,

Because i have more than one columns to be displayed that wise i choose table record instead of list record. Probably you are right, i can style it to make it similar to the table record.

Anyway i have tried to incorporate your solution into my own development and i find that it only display one category at a time instead. Not sure where gone wrong. 

My plan is to allow all the 5 categories to be display at the beginning with limit. 


Hello Jace,

You can have multiple columns in a ListRecords as well. The difference is that you need to manage it a little more "manually" than with a TableRecords (because of the style).

Also, you can have more control over the columns easier than with TableRecords.

I included the "Price" as a column of the Items.

https://eduardojauch.outsystemscloud.com/CategoriesAndItemsSameTable/Home.aspx?_ts=636405690917090441

Eduardo Jauch wrote:

Hello Jace,

You can have multiple columns in a ListRecords as well. The difference is that you need to manage it a little more "manually" than with a TableRecords (because of the style).

Also, you can have more control over the columns easier than with TableRecords.

I included the "Price" as a column of the Items.

https://eduardojauch.outsystemscloud.com/CategoriesAndItemsSameTable/Home.aspx?_ts=636405690917090441

Hi,

Awesome. I get what you trying to mean. :)

Your solution is what i am looking for but i facing a problem here. I got 5 categories and each category can have at least 100 records each. I want to display 5 categories each with 10 records at the beginning. And it will load to the next 10 records for each category subsequently when it click next, it is even possible??



Hi,

While I will say yes, it is possible to do it, with some processing, I would say that in this case a different approach would be better.

First important thing to define is:number of categories are fixed or configurable by the client/user?

Second. The number of items is the same for each category or is variable? 

Third: why do you want to present this in a "table" format? A section format would be better, in terms of user experience.

Depending on your answers, there are a number of different approaches you can try, that will be easier to implement. 

In any case, separating in different lists and using Killian's approach, with some extra code, would be probably the way to go, with less processing required than with the approach I suggested.

Cheers

Eduardo Jauch

Hi,

First important thing to define is:number of categories are fixed or configurable by the client/user?

- The number of categories will be fixed. In my case, it will be fixed at 5

Second. The number of items is the same for each category or is variable? 

- The number of items will not be the same for each category.

Third: why do you want to present this in a "table" format? A section format would be better, in terms of user experience.

- No specific reason to present this in a "table" format. I choose table format because i have multiple columns needed to be displayed. May i understand what you mean by a section format? 

Thanks for the help.


Hello Jace,

Because of weekend its late to reply you,

I see their are also alternative for your problems, That's good :)

Did you solve it or not?


Gopal Jite wrote:

Hello Jace,

Because of weekend its late to reply you,

I see their are also alternative for your problems, That's good :)

Did you solve it or not?


Hi Gopal,

Not really, still trying out how to hide away the table record when it is empty. I am trying out solution given by Kilian on  multi navigation


Helo Jace,

To hide a table/list records that is empty, put it inside the true branch of an IF, and srt the condition to something like aggregate.list.empty = false.

Give a name to the IF and now you can do an ajax refresh over it

Jace Jace wrote:

Hi Gopal,

Not really, still trying out how to hide away the table record when it is empty. I am trying out solution given by Kilian on  multi navigation


HI Jace,

Its very simple to hide table record if its empty,

Just put all your category table into the if condition and set condition like

1.For Fruit table

List_Navigation_GetStartIndex(WidgetId)<FruitList.Length

2.For Color table

List_Navigation_GetStartIndex(WidgetId)<ColorList.Length


Now we have 9 item in fruit, 12 in color and 6 in newList

The output will be