Why is this ListFilter function not working?
Question

I have a driver module which has a bunch of REST API methods. One of them returns a list of devices. It's wrapped in a server action. The Server Action calls the REST method. Then I attempt ListFilter on the output of the REST call. Then I assign that list to an output parameter. On the Client side, I just print the list. And yet.... we can see the values do not get filtered.  I have tried filtering the output parameter, sending the output paramter to a third variable and filtering that, and various other things. But I can't seem to get this list to filter on the baseis of the ConnectionStatus field.

Any ideas? Thanks!

whatthefrenchfries.png

Solution

You need to choose one of those green attributes in this case connectionstatus instead of putting GetDevicesResponse.(...)

In this case will be,

ToLower(ConnectionStatus)="connected"

Regards,

Márcio

I will give it a shot! Thanks, Marcio!

Still getting the same results. I understood right away what you were saying. The list is already being iterated so I just needed to specify the field. But when I changed it as you suggested, nothing changed in the result list.

Try to debug and see what the API method is returning, If is the "same" something is wrong before you filter...

Check the structure, you can also test the API. Check also if the mappings are ok, and once you change the drv you need to refresh the upper modules.

If you don't know how to debug have a look at the link.

https://www.outsystems.com/training/courses/141/debugging-in-outsystems/

To debug on the drv you need to have some reference on the frontend/end-user module where you are triggering in the interface, that way you will be able to debug. Dont forget to change the entry point to the frontend module, the application module once you are trying to debug the action on the DRV.

Regards,

Márcio

Hi Jason,

can you show what you ar doing in the assign after your listfilter.  Are you sure you are returning the result of the listFilter as server action output instead of the result of the api call.  

At the risk of offending you because you know this, a listFilter doesn't affect the list you are applying it on, but creates it's own result list.

Dorine

Solution

You need to choose one of those green attributes in this case connectionstatus instead of putting GetDevicesResponse.(...)

In this case will be,

ToLower(ConnectionStatus)="connected"

Regards,

Márcio

I will give it a shot! Thanks, Marcio!

Still getting the same results. I understood right away what you were saying. The list is already being iterated so I just needed to specify the field. But when I changed it as you suggested, nothing changed in the result list.

Try to debug and see what the API method is returning, If is the "same" something is wrong before you filter...

Check the structure, you can also test the API. Check also if the mappings are ok, and once you change the drv you need to refresh the upper modules.

If you don't know how to debug have a look at the link.

https://www.outsystems.com/training/courses/141/debugging-in-outsystems/

To debug on the drv you need to have some reference on the frontend/end-user module where you are triggering in the interface, that way you will be able to debug. Dont forget to change the entry point to the frontend module, the application module once you are trying to debug the action on the DRV.

Regards,

Márcio

Hi Jason,

can you show what you ar doing in the assign after your listfilter.  Are you sure you are returning the result of the listFilter as server action output instead of the result of the api call.  

At the risk of offending you because you know this, a listFilter doesn't affect the list you are applying it on, but creates it's own result list.

Dorine

Thanks to you both! I had both a context issue, and an incorrect assignment. @Dorine Boudry you didn't insult me at all. You helped me out, big time! I am very new to Outsystems and really benefit from this type of comment.

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