TABLE_TO_KV
Convert a Google Sheets range into URL key & value parameters with TABLE_TO_KV
Data GenerationCyrus RadfarThe TABLE_TO_KV function is a tool for building URLs our any key & value string quickly and properly.
The most common use case is for building trackable campaign links.
Function Signature
Argument Definitions
input [range]
- required - range of cells to transform with the keys included in the range.
key_location [number, default = 0]
The location of the key names, or headers.
- 0 - first row
- 1 - last row (bottom row)
- 2 - first column
- 3 - last column (far-right column)
no_key_encode [boolean, default = false]
- Keys are underscore encoded and pushed to lower-case by default. Turn off this feature by setting no_key_encode to true.
no_value_encode [boolean ,default = false]
- By default, URL encodes keys by replacing unsafe ASCII characters with a "%" followed by two hexadecimal digits. When TRUE, the values aren't transformed.
Use the Cheat
How to Add a Cheat to a Google SheetClick the Code Box to Copy
We've built an interactive tutorial in Google Sheets where it's easy to see how the function works. You can read the definition, edit examples, and do some practice examples to verify that you understand how to use the function.
Copy TutorialView TutorialDownload AppScript Code