I have various API calls, each potentially returning hundreds of outputs. I want to pull the last result from each call into another column. The challenge is that the number of results varies — some calls might have 230 outputs, others only 20. How can I always map the last result to another column?
To extract the last result from API calls with varying output lengths, click on a cell containing your API results to open the Cell details panel. Hover over the specific endpoint you want (the last item in your array) and click "Add as column" to create a new column with that data. You can also reference individual list items by drilling down to extract specific items within a list and access their properties, allowing you to target the last result regardless of array length.
to get hold of the last item in array you can slice the array in this form array[-1], you can get this done via formula
Exactly! You can use AI formulas to slice arrays and get the last item with array[-1]
syntax. Add a new formula column, then prompt our AI to extract the last item from your API results array using this slicing method. AI formulas are credit-free and perfect for data formatting tasks like this.
Hello João! Thanks for reaching out! You can trying using AI formulas to try and get the last item in your field!