Forum Discussion

Matt's avatar
Matt
New Contributor
6 years ago

Removing [] from JSON array

Hey Everyone,

I’m currently receiving data from an API and inserting the data into a MySQL database. Here’s an example of one of the columns that are coming over:
[“5bb1614c4fd80200018e33c4”,“5ca500003aaf6000014dbc98”,“5b5f558add2f28000151e88d”]

Is there a way to remove the brackets and " so that it’ll only be the records and the comma separating each value?

3 Replies

  • Ganesh's avatar
    Ganesh
    New Contributor II

    Hi,
    You can try Array.toString() function if its an array type or use string.replaceAll() function to achieve this.

  • ronmwhite's avatar
    ronmwhite
    New Contributor II

    It is hard to tell by what has been posted here, but, perhaps you need a JSON Splitter. At the right JSON path, you should get the unique GUID values required downstream. Feel free to ping me if you need any assistance. Thanks.

  • Kulashekharan's avatar
    Kulashekharan
    New Contributor II

    Use array.join(“,”) or array.toString() to achieve what you asked for. Join will allow you to change the delimiter. Keep in mind This returns one string value