โ06-06-2024 12:03 PM
I have a custom connector which I am creating a output field schema for.
The HTTP response is JSON in the following format:
{
Key: [
[
"string",
"string2",
"..."
]
],
Key2: "String",
Key3: "integer",
}
Here is a sample:
{...
"user_usage": [
[
"user-agent",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.54"
],
[
"user-agent",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"
],
],
"server_name": "THIS IS A SERVER",
...
}
How do I create the field definition schema for this Nested Array of a Nested Array? I've tried the below schema but it doesn't seem to work correctly. Looking through the docs, it seems to only accept a nested object for array "of" and not a nested array.
{
name:"user_usage",
type: "array",
of: "object",
properties:[
{
type:"array",
of: "string"
}
]
},
Solved! Go to Solution.
โ06-06-2024 02:56 PM
I got this to work for me in a recipe (not in the SDK):
[
{
"name": "outer_array",
"type": "array",
"optional": false,
"properties": [
{
"name": "array",
"type": "array",
"of": "string",
"control_type": "text",
"label": "Array"
}
],
"of": "object",
"label": "Outer array"
}
]
It's weird that the outer array is "of object", but it seems to be correct.
โ04-30-2025 06:17 AM
The example is that I would like to have a JSON schema for a Recipe function, that for a specific parameter it only accepts a predefined list of values (Enum):
https://json-schema.org/understanding-json-schema/reference/enum
โ05-01-2025 12:15 PM
Ignore my last response. I re-read your request. This is what you need:
[
{
"control_type": "select", // manual update
"label": "Enum",
"name": "enum",
"type": "string",
"optional": false,
"pick_list": [ // add this manually
[
"label", // the label the user sees in the UI when calling the function
"Value" // the actual value of the pick list opton
],
[
"one",
"1"
],
[
"two",
"2"
],
[
"three",
"3"
]
]
}
]
โ05-02-2025 06:45 AM
Thanks for the response, it works!.
Do you know if this is documented somewhere. It looks very similar to JSON Schema but it has some custom operators
โ05-02-2025 08:59 AM
This is documented as part of the custom connector SDK object definitions schema, but the documentation doesn't clearly state it can also be used in input fields in recipes (on triggers, in variables, etc.). However, the SDK and recipe actions both rely on the same object definition schemas, so it makes sense they would work in both places.