Skip to main content

Dynamically generating charts with quickchart

  • December 16, 2022
  • 2 replies
  • 57 views

Forum|alt.badge.img

I've been successful using Airtable data with quickchart.io to create charts that can be viewed in airtable or placed in Documint templates. 

What I'm trying to do now is "dynamically" code the chart inputs vice "hard coding"

Specifically: I would like to select the fields to plot using a multi-select field and have that dynamically encode the chartURL. 

Example: FieldsToPlot includes 4 items (Units, Rate, Shared, Credit)- and from this I need to dynamically create this code:
"&data1=" & ARRAYJOIN({Units}, ",") & "&data2=" & ARRAYJOIN({Rate}, ",") & "&data3=" & ARRAYJOIN({Shared}, ",") & "&data4=" & ARRAYJOIN({Credit}, ",")

I can use substitute() to alter the data from FieldsToPlot- but I'm stuck on incrementing the number since it won't always be 4 items. I've thought of using a count function to determine how many items, but I'm not sure how to increment the number in a formula without using a loop.. 

Anyone have any experience doing something like this?

2 replies

TheTimeSavingCo
Forum|alt.badge.img+31

Technically, you could solve this problem by hardcoding even more heh

Here's what I managed to come up with, works up to 150 select options:


I've DMed you the formula


Forum|alt.badge.img+18
  • Inspiring
  • February 25, 2023

@TheTimeSavingCo  Any chance you could DM me the formula you used here, also? 🙂