Page History
Section | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Google Connector Query and Path Parameters
If you want to retrieve or update data from a Google sheet, you must write a business rule which contains a query.
Queries to a Google sheet can include query parameters or parameters that are part of the path in the URL or a combination of both.
Queries using the Spreadsheet key
It is best practice to use the spreadsheet key in your business rule to specify the Google sheet. This method is recommended because each spreadsheet has it's own unique key. Using the key instead of the spreadsheet/worksheet name avoids issues that may occur if you have more than one spreadsheet with the same name.
The Google connector supports the use of the key as a path parameter:
- key - the GUID of your Google sheet. Use the key to specify your Google sheet instead of the sheet name (ssname) in your rule.
- To find the Google sheet key,
- Open your Google sheet.
- The key is the long string of characters between the d/ and the /edit in the URL in the address bar.
Ex: https://docs.google.com/spreadsheets/d/1FXYb7PJpozlFcJol12YNEwhFFwa-tvpO6OjU1wzxDTI/edit?usp=sharing
Here is an example of a query using the key to identify the Google sheet. Note the worksheet name and query string are passed as query parameters:
The query=<query string> parameter is where you specify which rows to match based on the data in your spreadsheet.
Warning |
---|
Variables in rules must be unique. Having duplicate variables in the same rule will cause the rule to fail but you may not get an error message. |
Queries using the Spreadsheet and Worksheet Name
Queries can also be written using the spreadsheet/worksheet name. This approach is not recommended because the rules will fail if you have more than one spreadsheet with the same name.
The Google connector supports the following URL query parameters. These parameters appear after the question mark () and are separated by an ampersand (&) in the URL:
- ssname - This is the name of your Google sheet.
- wsname - This is the name of the worksheet in your Google Sheet.
- query=<query string> - This is where you specify which rows to match based on the data in your spreadsheet.
The image shows a query that reads from a Google sheet named Google Connector Address Sheet and a worksheet (tab) named Sheet1.
Warning | ||||||
---|---|---|---|---|---|---|
The column name on a Google sheet must match the control name. The matching is case-insensitive and any spaces in the column name are ignored. A control named "FirstName" matches a column header "first name." However, references to Google Sheet columns in your rule must be lower case and cannot contain spaces. The correct reference for this example is "firstname."
|
Google supports special characters in Google Sheet and Worksheet Names. If you are using
Frevvoproduct |
---|
Avoid leading/trailing spaces in spreadsheet or worksheet names when using rules to read/update Google sheets. Spaces in the Google Sheet and worksheet names should be encoded with the + (plus) sign. For example, a worksheet named Employee Information should be encoded as Employee+Information.
Refer to Create a Dynamic Pick List from a Google Sheet, Update a Google Sheet and Reading from a Google Sheet for examples.