I need to loop through an array and find the lowest integer from a range of integers.

Options
Xano Support Chat
Xano Support Chat Administrator

ADMIN

edited April 2023 in ? Transforming data

I'm unsure how to perform something.
I receive an array of data from an external API which contains prices. I have no control/fidelity of sort on the array.
I need to identify the lowest price (integer) in the array and display this to my front end.
I'm really unsure how to achieve this, could you help?

Tagged:

Best Answer

  • Xano Support Chat
    Xano Support Chat Administrator

    ADMIN

    edited April 2023 Answer ✓
    Options

    This can be accomplished with a single filter: array_min. By applying this filter to your array, it will return the minimum value of the array.