Change an array to mySQL list

Hi Retool Team,

I would like to do the following in mySQL:

  1. Use the SQL mode (not the GUI mode) to Insert new record in Table A
  2. Update column 1 in Table B = last_insert_id() in Table A, where column 2 in Table B = a list, i.e (1,2,3)

The issue

  • the list return from JS is [1,2,3] for action 2
  • mySQL only suppots
    UPDATE Table B
    SET Column 1 = LAST_INSERT_ID()
    WHERE COLUMN 2 IN (1, 2, 3)

Question

  • How can I convert an array [1,2,3] to a mySQL list (1,2,3), please?
  • The JS join() returns string “1, 2, 3” instead

Hi @oliver.ng!

Would this section in our docs be helpful?