Low severitydata quality
Power BI Refresh Error:
OBJECT key not found
What does this error mean?
A key lookup on a Snowflake OBJECT or VARIANT value returned NULL or raised an error because the specified key does not exist in the object. This is the semi-structured data equivalent of a missing column.
Common causes
- 1Accessing variant_col:key_name where key_name is not present in the JSON object for that row
- 2Case sensitivity mismatch between the key name in the query and the actual key in the JSON
- 3An upstream API or data producer removed or renamed a JSON field without updating downstream queries
- 4Using dot notation (col.key) on a VARIANT column where some rows contain non-object types (e.g. arrays or scalars)
- 5A PARSE_JSON expression on a malformed string produced NULL, and subsequent key access on NULL silently cascades
How to fix it
- 1Use GET(variant_col, 'key_name') which returns NULL safely instead of dot notation.
- 2Check key existence first: IFF(IS_OBJECT(variant_col) AND variant_col:key_name IS NOT NULL, variant_col:key_name, NULL).
- 3Use GET_PATH(variant_col, 'nested.key') for deep nested access, which handles missing intermediate keys gracefully.
- 4Normalize JSON keys to lowercase in the ingestion step to avoid case sensitivity issues.
- 5Add a data quality check upstream to validate the presence of required keys before the pipeline writes.