Issue
I need help filtering and displaying a specific status field data in a list widget after making an API call using JavaScript. I have received the response data successfully in the console, but I am unable to show the filtered data in the list. I'm looking for guidance on how to use the .filter() method to filter data based on its status field. Additionally, I have a button that redirects me to a page where I need to access the ID. Can you help me send query parameters with the URL using navigateTo and access them on the next page with appsmith.URL.queryParams?
Resolution
The user was trying to filter data by a status field ("pickup" or "drop") returned from an API call and display only the "drop" status data in a list widget. To solve this, they can use the .filter() method in JavaScript to filter the data based on the status field. They can use code similar to this:
parcel_reservation_dtl.data.records.filter(record => record.reservation_status === "drop")
This will return a filtered array containing only records where the status is "drop".
If the user needs to access the ID on the next page after being redirected from a button click, they can send query parameters with the URL using navigateTo and access them on the next page with appsmith.URL.queryParams.