Filter API using a variable converted

Hi guys,

I need a help to filter an API Call. I have setup my backend to query results based on the filter. The filter variable came from a choice chips (list String) and build the logic:

  1. When no choice is selected (Choice value: null or empty string) -> query all results

  2. When a choice is selected (choice value: selection) -> query only selected results

This If-condition is build on the backend API call setup when I'm passing the query variable

Screen Shot 2023-08-12 at 01.25.56.png
39.1KB

My dilema is:

When I hardcore text directly, the API call results, like in the picture below that I put "B6" on the variable field. So everything works well

Screen Shot 2023-08-12 at 01.25.34.png
36.94KB

When I select the chips, and the List String is converted to a simple String thru a Custom Function and put on the Else condition. I get a error message.

Screen Shot 2023-08-12 at 01.25.09.png
40.43KB

I could't find a way to make the backend query receive the results from the choice chips for filtering. The string out of the custom function seems to be ok.

He is the Custom function:

String convertToString(List<String> choiceL) {

return choiceL.join(', ');

Error message

Screen Shot 2023-08-12 at 01.35.50.png
59.63KB

any help to make the backend query send the variable so the API results came back filtered will help. Appreciate

Gustavo

8 replies