TAG
Converts a 2-column key|value table (default) or 2-row key|value table into a single JSON tag object.
Syntax
TAG(table, [orientation])
Arguments
| Argument |
Description |
Required |
table |
For rows (default): Nx2 table with keys in column 1 and values in column 2. For columns: 2xN table with keys in row 1 and values in row 2. |
Required |
orientation |
Optional. row/rows (default), column/columns, TRUE/FALSE, or 1/0. |
Optional |
Examples
Vertical key|value list (default rows orientation)
=TAG(A1:B3)
Result ⇒
{"Name":"John","Age":"25","City":"NYC"}
| Name |
John |
| Age |
25 |
| City |
NYC |
Horizontal key|value pair (columns orientation)
=TAG(A1:B2, "columns")
Result ⇒
{"Product":"Widget","Price":"9.99"}
| Product |
Price |
| Widget |
9.99 |
Related Functions
Other Special Functions & Keywords functions:
- CELL - Current cell value in criteria formulas
- COL - Column value using COL[A] or COL[1] syntax
- CSV - Serializes a table to a high-precision CSV string (CRLF between rows). Trailing empty rows and columns are cropped; internal blanks are kept. Wrap the cell or increase row height to see every line.
- FROMCSV - Parses a high-precision CSV string into a spilled table. Inverse of CSV.
- FROMTAG - Extracts a field value from a single JSON tag object produced by TAG or TAGS spillover.
- ONCE - Returns the value of the inner formula and only executes once, turning the cell into a value
- ONCHANGE - Returns initial_value until the range changes, then returns value_after_change and converts the cell to a static value
- RECORDID - Salesforce record ID for this workbook
- TAGS - Converts a table with headers and rows into a JSON object array. There should be a "label" column and each row is rendered as a hoverable tag with that label.
- USERID - Current logged-in user's ID
← Back to Formula Reference