Spreadsheet integration

Connect a public Google Sheet to the card-pack model to update parameters from a spreadsheet. Tip Learn more about Google Sheets integration here.

If you already have a spreadsheet where all your loot box parameters are stored, Machinations can grab those values directly. This means you can tweak the values directly from the spreadsheet, and see the results change in the diagram.

Tip

Learn more about Google Sheets integration here.

Hearthstone variables · Rarities
VariableCommonRareEpicLegendary
Drop Chances722341
Card Count3101185841
Disenchant Value520100400
Craft Cost1002008001600
Craft Preference110100400
Values transcribed from the linked Hearthstone Variables Google Sheet, Rarities tab.

We’ve created a spreadsheet which contains all the variables our model needs.

Note

Google Sheets must be Public to be accessed by Machinations.

Alternatively, if you have access to Private Google Sheets, simply make sure you’re using the same email account to access both the spreadsheet and Machinations.

Here, we’ve connected the spreadsheet in the Data tab (under Add connector, choose Google Sheets), and a parameter reads the entire set of variables from it:

The Google Sheets form with Public selected: Name, Sheet id, Sheet tab title, Query and the header options.

With our pre-existing parameters, we can reference a particular row of data from the parameter we just created from the connected sheet, and use that to overwrite the existing data we added to each variable.

The New parameter dialog with the name loot_bonus and the formula loot_value + 1, which refers to another parameter.The New parameter dialog with the name loot_bonus and the formula loot_value + 1, which refers to another parameter.
Important

Notice when hitting Play that our DropChances variable has an extra pair of square brackets around it. This will cause an error in our diagram.

Warning

Parameters read from Google Sheets are always two-dimensional arrays.

To remove redundant square brackets from an array, use the flatten() function.

The New parameter dialog with the name DropChances and the formula flatten(HearthstoneVariables[1]), which removes the extra pair of square bracketsThe New parameter dialog with the name DropChances and the formula flatten(HearthstoneVariables[1]), which removes the extra pair of square brackets

After adding the flatten() function to our parameter, the array will be restored to its original format, and the diagram will work correctly again.

Note

Any change to the linked spreadsheet will be automatically reflected in Machinations on hitting Play or Forecast.