Help

Convert an Array (Multiple Select) into a String with formatting

Solved
Jump to Solution
440 2
cancel
Showing results for 
Search instead for 
Did you mean: 
jdoepker
4 - Data Explorer
4 - Data Explorer

Hi there,

I'm trying to utilize Airtable to manage Shopify Metafields (among other things), but am striking out with doing this in what I believe to be the most logical way.

I've configured a field (column) as "multiple select" with preconfigured options (the array). This ensures we're dealing with legitimate values.

Syncing to Shopify, through the use of AirPower, requires the metafields to be in the format:

["MF1","MF2","MF3"] 

I've used ARRAYJOIN to convert the array to a string in a separate field, but am stumped at actually formatting the square brackets and quotes.

Suggestions?

TIA,

Jeff

1 Solution

Accepted Solutions
TheTimeSavingCo
15 - Saturn
15 - Saturn

Try something like:

 

'["' & 
SUBSTITUTE(
  Data,
  ', ',
  '", "'
) &
'"]'

 

Screenshot 2023-01-01 at 8.42.53 PM.png

See Solution in Thread

2 Replies 2
TheTimeSavingCo
15 - Saturn
15 - Saturn

Try something like:

 

'["' & 
SUBSTITUTE(
  Data,
  ', ',
  '", "'
) &
'"]'

 

Screenshot 2023-01-01 at 8.42.53 PM.png

jdoepker
4 - Data Explorer
4 - Data Explorer

Thank you very much Adam!

This worked perfectly.