How to get the LAST bundle value from an array aggregator using the iterator function

Hey you guys,

Soooo, I am creating a co





nversational chatbot and I want to get the LAST bundle value from an array aggregator using the array iterator module.

I will attach the screenshots of what I have currently.

Hey Cameron,

you can use the last() function to retrieve the last item form an array. But with the way slice() is configured, you only have the first item inside at the moment. What is the point of slicing the array?

1 Like

Hey Stoyan,

As you can tell, I am a novice with extracting data.

How the workflow is structured is that a lead responds to a SMS message, that message is classified by AI and then I use d Google Sheet ‘addRow’ module.

I’m essentially using the Google Sheet as the ‘AI memory’ for it to be able to retrieve each message of the conversation to help it generate an intelligent response.

Have you ever dealt with something like this?

You don’t need the iterator or the Alice function I this case, just use last() directly and it will retrieve the latest message.

1 Like

ok cool. I am going to try that and I will let you know what I get. Thank you bro!

Quick question.
I added the last() function to an array I received from my array aggregator. Why is it saying that my array is not valid?


Because that’s not an array you mapped there, that’s an item from the array. You can use the map() function to get a primitive array of row numbers and use last() on that one to get the last row number.