Help

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

Solved
Jump to Solution
2733 0
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
18 - Pluto
18 - Pluto

Try something like:

 

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

 

Screenshot 2023-01-01 at 8.42.53 PM.png

See Solution in Thread

3 Replies 3
TheTimeSavingCo
18 - Pluto
18 - Pluto

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. 

Théau
4 - Data Explorer
4 - Data Explorer

Hey @jdoepker, you can also check SyncBase (an Airtable Shopify integration) I've created.

In opposition to Airpower we're doing this job on our side, and it syncs instantly (few seconds).

Happy to give more info if needed! 

Théau