94
Views
18
Comments
Solved
Filter in mobile app

Hi!

I am new to Outsystems and trying to make a mobile app with a culture program that can be filtered by day and location (names in Norwegian). I can't seem to get the filter right, and don't know where the problem is. Can someone help? I have attached the oml-file. Thanks in advance!

KulturprogramNY.oml
2021-11-30 12-35-05
Ricardo Ferreira
Solution

Hi Camilla, I took a look at your oml. So basically you have to filter by StedId and DagId in the GetKulturprogramsByDagId aggregate. But looking at your Kulturprogram records you haven't defined any Id for StedId and DagId, so they're all with Id = 0. So when you change the dropdown you won't see any result.



Another tip, you had 2 actions to refresh the aggregate on change but you can have only one action and call it on both dropdowns on change envent. 


Hope it helped!


Edit: Another note, you need to fetch the aggregates "At start", like Khuong described.

UserImage.jpg
Camilla Berge

Thanks a lot! But how do I manage to change the id's to other values than 0? 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Camilla,

Without having looked at the module (not time currently), can you describe better what you mean by "not getting the filter right"? What are you trying to do, and what goes wrong?

UserImage.jpg
Camilla Berge

I have three entities. One is the culture-program, that I want to show in the output list on the screen. The two others are day and location, that also are attributes in the culture program entity. I want to filter by day and location and show the filtered program in a list below on the screen. When I try to select day and location in the filters, nothing happens in the output list. 

Hope this was clarifying :)

2020-11-13 07-48-15
Khuong Truong

Hi Camilla,

I updated your .oml please take a look.

I added 2 filters into your aggregate. 

Regards,

Khuong

KulturprogramNY.oml
UserImage.jpg
Camilla Berge

Thanks, but it doesn't seem to work when I open browser. 

2020-11-13 07-48-15
Khuong Truong

I updated again please take a look.

Need to Fetch GetDags and GetSteds aggregates At start.

KulturprogramNY.oml
2021-11-30 12-35-05
Ricardo Ferreira
Solution

Hi Camilla, I took a look at your oml. So basically you have to filter by StedId and DagId in the GetKulturprogramsByDagId aggregate. But looking at your Kulturprogram records you haven't defined any Id for StedId and DagId, so they're all with Id = 0. So when you change the dropdown you won't see any result.



Another tip, you had 2 actions to refresh the aggregate on change but you can have only one action and call it on both dropdowns on change envent. 


Hope it helped!


Edit: Another note, you need to fetch the aggregates "At start", like Khuong described.

UserImage.jpg
Camilla Berge

Thanks a lot! But how do I manage to change the id's to other values than 0? 

2021-11-30 12-35-05
Ricardo Ferreira

Well, right now you can do it manually when viewing the Kulturprogram Entity data like in the image below: 

They are all 0 because you are not assigning them when you do the bootstrap from the excel file to fill the Entity. You can use this article as a reference to do that.


UserImage.jpg
Camilla Berge

It seems like I don't have the dropdown-options to edit the records of the attribute

Skjermbilde 2021-11-12 kl. 13.43.32.png
2021-11-30 12-35-05
Ricardo Ferreira

Do you have service studio's last version installed?

2022-11-16 17-10-37
Ambar mishra
Champion

Hi @Camilla Berge ,

Please find the attached working OML. Created  update KultureProgram screen to update existing records and add values to StedId and DagId.

Also, as per Ricardo comment above you are not having latest version of service studio. Please update your service studio to get the latest features (here its updating table records).

Hope this helps.

Thanks

KulturprogramUpdatedByAmbar.oml
UserImage.jpg
Camilla Berge

Hi! Thanks for helping. I get a warning-message when I try to update the records in the browser, see screenshot attached. Also, I have the latest version installed. 

Skjermbilde 2021-11-14 kl. 11.00.11.png
2022-11-16 17-10-37
Ambar mishra
Champion

I am able to update this record successfully. Did you change anything on code or datamodel? Can you please share OML 

UserImage.jpg
Camilla Berge

Did not change anything in the code, but seems like my environment was not updated to the latest version. Managed to solve the problem by switching to personal environment, since this had the latest update. Thank you so much!

2022-11-16 17-10-37
Ambar mishra
Champion
UserImage.jpg
Camilla Berge

Figured out that the environment (not using personal environment) wasn't updated. Turns out that by switching to personlig environment, I was able to directly update the records of the entity in Outsystems. Only using one on-change event for the filter also seemed to fix the problem. 

Thanks for all help!

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