matg
Member
Hi,
I have an API response that has 1 to many responses, and instead of nesting it in an array it returns as many keys as there are items and increments the index... mediaUrl0, mediaUrl1, etc. it can be as many as mediaUrl20... here's an example:
My goal is to store all of these media strings in an array field in a postgres database, and I was going to write a simple Pabbly Code <> JavaScript workflow that will loop over the objects and pluck any that match a regex similar to mediaUrll\d+ and then create the literal insert statement, e.g. ["https://url1", "https://url2"] and insert that way
Hover, when using code I can only grab individual keys off of the response object, I cannot figure out how grab the entire response as an object so that I could grab the keys and do the aforementioned work, e.g.
is it possible to get the entire raw response as an object here?
Thanks,
MatG
I have an API response that has 1 to many responses, and instead of nesting it in an array it returns as many keys as there are items and increments the index... mediaUrl0, mediaUrl1, etc. it can be as many as mediaUrl20... here's an example:
My goal is to store all of these media strings in an array field in a postgres database, and I was going to write a simple Pabbly Code <> JavaScript workflow that will loop over the objects and pluck any that match a regex similar to mediaUrll\d+ and then create the literal insert statement, e.g. ["https://url1", "https://url2"] and insert that way
Hover, when using code I can only grab individual keys off of the response object, I cannot figure out how grab the entire response as an object so that I could grab the keys and do the aforementioned work, e.g.
is it possible to get the entire raw response as an object here?
Thanks,
MatG