How to filter data by date from external api request

Options

I have an endpoint that lists invoices. An invoice has a query parameter called “modified” which is a timestamp. How do I fetch those invoices that have been modified after my modified query parameter?

Best Answer

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Answer ✓
    Options

    Hi @chrstnstl it's most likely you can do this directly on the External API call itself. You'll need to read the API documentation of the service that you're using. They will have details on how you can do this directly calling the API. Typically this is a certain query parameter(s) that you can define.

    If you just want to return everything first, then filter your results, Xano can do this. I would recommend using the Array function Find All Elements. You can set WHERE statements to return results that match what you've defined, therefore filter all the results you return.

    However, I'd recommend only doing the second option if for some reason the API service doesn't let you filter the incoming results with defined parameters.