|
|
@ -1379,6 +1379,24 @@ export const formulas: Record<string, FormulaMeta> = { |
|
|
|
docsUrl: |
|
|
|
docsUrl: |
|
|
|
'https://docs.nocodb.com/fields/field-types/formula/numeric-functions#value', |
|
|
|
'https://docs.nocodb.com/fields/field-types/formula/numeric-functions#value', |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
JSON_EXTRACT: { |
|
|
|
|
|
|
|
docsUrl: |
|
|
|
|
|
|
|
'https://docs.nocodb.com/fields/field-types/formula/json-functions#json_extract', |
|
|
|
|
|
|
|
validation: { |
|
|
|
|
|
|
|
args: { |
|
|
|
|
|
|
|
min: 2, |
|
|
|
|
|
|
|
max: 2, |
|
|
|
|
|
|
|
type: [FormulaDataTypes.STRING, FormulaDataTypes.STRING], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
description: 'Extracts a value from a JSON string using a jq-like syntax', |
|
|
|
|
|
|
|
syntax: 'JSON_EXTRACT(json_string, path)', |
|
|
|
|
|
|
|
examples: [ |
|
|
|
|
|
|
|
'JSON_EXTRACT(\'{"a": {"b": "c"}}\', \'.a.b\') => "c"', |
|
|
|
|
|
|
|
"JSON_EXTRACT({json_column}, '.key')", |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
returnType: FormulaDataTypes.STRING, |
|
|
|
|
|
|
|
}, |
|
|
|
// Disabling these functions for now; these act as alias for CreatedAt & UpdatedAt fields;
|
|
|
|
// Disabling these functions for now; these act as alias for CreatedAt & UpdatedAt fields;
|
|
|
|
// Issue: Error noticed if CreatedAt & UpdatedAt fields are removed from the table after creating these formulas
|
|
|
|
// Issue: Error noticed if CreatedAt & UpdatedAt fields are removed from the table after creating these formulas
|
|
|
|
//
|
|
|
|
//
|
|
|
|