Custom Variables

    Documentation

    Public Google Sheets

    Public Google Sheets

    success

    Custom variables can be set up to ingest data from a public Google Sheet. As the name suggests, the Google Sheet must be public. However, you should consider other methods of data ingestion if you rely on data privacy!

    Name:

    This is the name of your new custom variable. Please remember that they are case-sensitive.

    Sheet ID:

    You can find the Google Sheets ID in the URL of your Google Sheet. The ID is the long string of random characters between the “/d/” and the “/edit” in the URL.

    For example, if your Google Sheet URL is “https://docs.google.com/spreadsheets/d/1bBMm-T3DCxqSX8UzRTiYUIGjShQ9DVOV7snmVu02BLU/edit#gid=0″, then the ID is “1bBMm-T3DCxqSX8UzRTiYUIGjShQ9DVOV7snmVu02BLU“.

    Sheet Tab Title:

    Please type the exact name of the Google Sheet tab you want to import. If this field is left empty, the first tab of your Google sheet will be selected by default.

    Query:

    Use a Google Sheets query to select the data for your Custom Variable. You can type your query formula in this cell. If you query is valid, you will see a preview of the data being fetched from your Google Sheet. You will also see an error message if your query is invalid.

    You can find more information about queries here.

    info

    Important:

    • If your sheet contains columns with only text, they will be interpreted as 0 and cannot be used as values in a custom variable, except for headers cells.
    • The cells in your sheet must contain numeric values. This includes the resulting values of a cell formula.
    • All numeric values fetched from one or several columns will be converted into a 2-dimensional array.

    Once you have set up the custom variable, it is time to access its values using another custom variable or the formula field in a Register, Resource Connection, or State Connection.

    Each row of your Google Sheet will be interpreted as an array, resulting in a 2-dimensional array for more than one selected columns.

    You can access the individual values using the following syntax: VariableName[Row,Column]

    In this example the name of our Custom Variable is Encounter_TL.

    To access the value for Gold for the first encounter on the list (encounter_1) in the table on the right (Public Google Sheet), you can use the following formula:

    Encounter_LT[1,3]

    The result will be 5. You can combine multiple State Connections or Registers to access all values within the Encounter_LT Array.

    For more information on Arrays and how to access their values, please refer to the Using Arrays section in our Math Expression article.

    Contents

    All Rights Reserved © Machinations S.àr.l

    8217, Mamer, Luxembourg, accounts at BGL BNP PARIBAS, VAT number: LU30464284

    We use cookies for marketing and analytics. We also share information about your use of our site with our marketing and analytics partners who may combine it with other information that you’ve provided to them. You consent to our cookies if you continue to use our site. Learn more