Using button group to filter list
Question

Hi, I have an app that will list all our zoom users from an Excel file I will load.

There are 4 buttons in a button group

500, 1000, 5000, 10000

in the database, these are listed as License500, License1000 etc.

When I click on the "500"  button I want it to only show me records where "License500" is entered.

So far:

I have bootstrapped an Excel file 'ZoomusUsers3' as my Data (this is my Entity name.. yes?)

I have created 4 filters (one for each button size respectively)

ZoomusUsers3.LicenseType = "Webinar500"

I have created a screen Variable with the name: LicenseSize

I need to set the Data Type to something, but I don't know what..

I set the property value of each of my 4 buttons to Entities.LicenseType.Label assuming that it would use the label of the button as the value that I am filtering by based on advice in this issue: https://www.outsystems.com/forums/discussion/68048/use-button-group-to-filter-by-a-list-attribute/ ) but, I get an error of 'Can't Identify 'LicenseType" element in expression'

Just a thought, but should the expression be Entities.ZoomUsers3.LicenseType ??

I have another Entity called ZoomusUsers3 under GetZoomUsers3s with an enclosed action of ButtonGroup1OnChange. I'm guessing that I need to add the action that is performed when I click on one of the buttons, currently, the client action (ButtonGroup1OnChange) only has Start & End with only a blue plus in the middle.

I can tell that I am getting close!

Looking forward to your comments :)

Thanks so much!

Paul







mvp_badge
MVP

Hi Paul,

To help you better, I do have some question regarding the mentioned implementation.

  • I hope the use case is to filter the zoom user records based on LicenseType, for that is it that you are holding the LicenseTypeIdentifier value in the ZoomusUsers3 entity for each record?
  • During the data bootstrap process, does the logic also map the LicenseTypeIdentifier value for each newly created record in the ZoomusUsers3 entity?
  • Why the aggregate filter condition does have the hardcoded string value "Webinar500"?

See this sample screen

For the mentioned use case - consider the GenderType Button Group filter in the illustration app as the LicenseType filter and try to understand the implementation.


Solution Steps

  • Introduce an LicenseType Identifier data type attribute in the ZoomusUsers3 entity i.e. ZoomusUsers3.LicenseTypeId
  • During the data bootstrap from the excel file, ensure that the data bootstrap logic also populate the LicenseTypeId attribute with the respective static entity record identifier value
  • Each Button value in the ButtonGroup should be a LicenseType record Id value
  • The Button Group variable should be mapped with a local variable of LicenseType (static entity) Identifier data type (let's call it: LicenseTypeId)
  • OnChange of the Button Group, refresh the screen aggregate which includes the filter condition
  • ZoomusUsers3.LicenseTypeId = LicenseTypeId


Please refer to the attached .oml file.

If you are still facing any problem in implementing, please share the sample .oml file with us.


I hope this helps you!


Kind regards,

Benjith Sam

RWALabBtnGrpFilter.oml

I have spent some time, and I didn't see the reply before I started. But here you have the solution.

You just have to create a new variable, based on the identifier of the license type, and every time you click, you use the on change to refresh, and in your aggregate, you have the filter, to filter by the license type chosen with the identifier that is on the zoom entity referenced.

Regards,

Márcio C.

zoomusers.oml

Thank you for your suggestions - someday soon I hope your words will make sense :)

When I click to download the OML nothing happens, I am using Chrome on Windows

I also need to learn how to share an OML file, not sure where to locate it. Am I correct that it does not include the database data?

Ben, OutSystems is still a foreign language to me, so much of what you wrote makes no sense, however, your gender example is exactly what I am looking to do with my zoom user data.

Marcio, same feedback on understanding the OutSystems speak. I am hoping that working through this problem will help me better describe what I have done and read on how to solve it.

I'm thinking that I should maybe start from scratch as I have tried to implement suggestions by others and through reading and as a result I have not named things in a way that helps me understand what's going on. 

Paul


:D No problem, you will!! Try to open on another browser, like edge if you have it, or see if your browser is blocking somehow the download.

You can read, how to use button groups, how to filter data on aggregates, you will manage!

https://success.outsystems.com/Support/Forge_Components/Forge_FAQs/Sharing_a_Project

This is how you share an oml. Go to the tab module, go to export, and then save as

Regards,

Márcio C.

What you don't understand? And what you understand?

  • ThanksIntroduce an LicenseType Identifier data type attribute in the ZoomusUsers3 entity i.e. ZoomusUsers3.LicenseTypeId

When you say "introduce", do you mean "Enter"? The Entity is the database, right?

  • During the data bootstrap from the excel file, ensure that the data bootstrap logic also populate the LicenseTypeId attribute with the respective static entity record identifier value

I don't know, I'm just using the menu command to import the Excel file, I have no idea how to know if the LicenseTypeId is being populated.

  • Each Button value in the ButtonGroup should be a LicenseType record Id value

There are only 4 buttons, but many records. This does not make sense...

  • The Button Group variable should be mapped with a local variable of LicenseType (static entity) Identifier data type (let's call it: LicenseTypeId)

Why does the button group need a variable? What do you mean by "Mapped"?


Thanks!

It needs a variable to hold the license type select to filter on the aggregate!

The buttongroup it will have that variable(of type license type identifier) and the button group items you must select the label from license type, in this case on the img, you have Entities.LicenseType.Type3

Hello @Paul Shoemaker , any updates?

Hello Marcio, Thanks for the follow-up - I was on holiday last week and did not do any work on this, but will delving back into it this week. I need to do some footwork on my end to really learn and I will get back to you with more informed questions. :)

Paul

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.