HELP! filter arrays and select the latest /not empty option

Options

Hello everyone;

Im working with an external API where Im receiving an arrays of repeat information which I would like to safe in a variable.

my problem:

Im receiving data with several array of different dates, which each contains the latest information from that date.

some of the date arrays are empty and other are not.

Im looking to retrieve the array (cityPlots) from (the latest date) where "cityPlot" is not empty.

I being playing around with filters such as "last", "not_empty" and looping thur information to retrieve the desire array and save in a Var, but I`d had no luck.

any help will be much appreciated.


Tagged:

Answers

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    edited December 2022
    Options

    Hi @FranciscoMartinez you can filter the empty results by applying the filter_empty filter. If your results are always in sequential order like the response you've shown above then you could also apply the pop filter and it should give you your desired result.