Update Collection error

Hi

I have a paginated collection which is retrieved from xano. looks like this

I want to use “UPDATE COLLECTION” inside a workflow so the front end gets updated. (just front end…)

I keep getting this error

name: "TypeError"

stack: "TypeError: m.findIndex is not a function at Object.updateCollection (https://editor-cdn.weweb.io/public/js/index.43a138e7.js:1:440354) at E (https://editor-cdn.weweb.io/public/js/index.43a138e..."

message: "m.findIndex is not a function"

I tried both id and items.id for id key

Any clue why its giving that error ?

Hello @dingan

The action will only work if your collection is an array/list of data. In the case of a paginated Xano collection, Xano returns an object. Supabase doesn’t, hence no issues with it.

Is there an alternative way to do this when collection is xano based

For now, no, you need to check if there is a way for Xano to return an array. It’s a Xano issue.

Did you get this to work?

I’m attempting to update an item within a Kanban after being dragged to a different column (status). Seeing the same error you are even though my structure in Xano is to listen for a Raw JSON payload.

Hi, if you just wrap you Xano response between ‘[’ ']'s, then the update will work.
EDIT: scratch that, it will just mess up the whole collection
EDIT2: I just got that I have to change the collection API, not the update API.

I don’t know how many records you expect in the future and how many fields/properties/data you want to fetch, but the DOM can handle quite a lot. Then you can paginate at the front end and your collection week will be an array.