SheetRocks
Documentation/Formulas/TAGS

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.

Syntax

TAGS(table, [spillover])

Arguments

Argument Description Required
table The table array where the first row contains headers and subsequent rows contain data Required
spillover Boolean (default FALSE). If TRUE, outputs array of tags (1 per row) instead of zipped JSON string Optional

Examples

Convert table to JSON objects

=TAGS(A1:C3)
Result ⇒ [{"Name":"John","Age":"25","City":"NYC"},{"Name":"Jane","Age":"30","City":"LA"}]
A B C
1 Name Age City
2 John 25 NYC
3 Jane 30 LA

Product catalog to JSON

=TAGS(A1:B3)
Result ⇒ [{"Product":"Widget","Price":"9.99"},{"Product":"Gadget","Price":"19.99"}]
A B
1 Product Price
2 Widget 9.99
3 Gadget 19.99

Employee data transformation

=TAGS(A1:B3)
Result ⇒ [{"ID":"1","Department":"Sales"},{"ID":"2","Department":"Marketing"}]
A B
1 ID Department
2 001 Sales
3 002 Marketing

Spillover array output

=TAGS(A1:C3, TRUE)
Result ⇒ {"Name":"John","Age":"25","City":"NYC"}
A B C
1 Name Age City
2 John 25 NYC
3 Jane 30 LA

Related Functions

Other Special Functions & Keywords functions:


← Back to Formula Reference