Import data from google spreadsheet

Hello, I'm using of text blaze business currently.

I would like to import some data from my google spreadsheet which is continuously updated.
Please kindly find the attachments.

1

By pull-down function, when I select Brand A, then I would like to display Brand A's information as attached below.

2

I would appreciate it if you could let me know how to do it.

Hello Naoto,

You can achieve what you're looking for by following this guide. However, since that only shows you how to use it with a single-column format I've added the code below so support any amount of rows and columns.

Make sure to update the Google Sheets url to your own publicly available CSV file. Also note the preview below won't work since it can't connect to Google Sheets from here.

{note: preview=no}
{urlload: https://docs.google.com/spreadsheets/d/e/2PACX-1vTb4m7LqydZBVbHEuDtW0lQHy_pw7oIjJjMSnv7tYmpoQwSsfc0CDXePXgXs8ntGrKECSvtA2FEhyfq/pub?output=csv; done=(res) -> ["csv_data": res]}

{options=slice(split(catch(csv_data, ""), "\n"), 2)}
Labels minus the first one which is the brand name
{labels=slice(split(catch(split(catch(csv_data, ""), "\n")[1], ""), ","), 2)}
{optionsArray=map(options, (n, i) -> split(catch(n, ""), ","))}
{optionsbyindex=[option[1]: slice(option, 2) for option in optionsarray]}
{brandNames=map(optionsarray, (option, i) -> option[1])}
{endnote: trim=right}

{formmenu: values={=brandnames}; name=selectedBrand}

Selected brand: {=selectedbrand}
{repeat: for (label, index) in labels}
{=label}: {=optionsbyindex[selectedBrand][index]}
{endrepeat}