Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
It is called by the framework prior to a component initialization. Returns an object schema based on nomenclature defined in manifest, for any output property of type object.
Available for
Model-driven apps, canvas apps, & portals.
Syntax
getOutputSchema(context)
Remarks
The output will contain JSON schema for each property of type object defined in the manifest.
For example, if the manifest has an output property of type object called MyOutputObject, and your control should return an object like this for value of MyOutputObject property:
{
"ProductName": "sample name",
"Value": 123.4
}
Then you should return:
{
"MyOutputObject": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"ProductName": {
"type": "string"
},
"Value": {
"type": "number"
}
}
}
}
The return schema is a subset of the JSON schema. Supported types and keyword for JSON schema:
stringintegernumberarrayitems
objectproperties
boolean
Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| context | Context | yes | The Input Properties containing the parameters, component metadata and interface functions. |
Example
Control has an object type output property called MyOutputObject and the value looks like this:
{
id: 10,
productDetails: {
name: "Test Product",
price: 100.23,
},
itemList: [
{
itemId: 1,
name: "Item-1",
value: 123,
active: true,
},
{
itemId: 2,
name: "Item-2",
value: 234,
active: false,
}
]
};
GetOutputSchema implementation:
public async getOutputSchema(context: ComponentFramework.Context<IInputs>):
Promise<Record<string, unknown>> {
return Promise.resolve({
MyOutputObject: {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"productDetails": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"price": {
"type": "number"
}
}
},
"itemList": {
"type": "array",
"items":
{
"type": "object",
"properties": {
"itemId": {
"type": "integer"
},
"name": {
"type": "string"
},
"value": {
"type": "integer"
},
"active": {
"type": "boolean"
},
}
}
}
}
}
});
}
Related articles
Control
Power Apps component framework API reference
Power Apps component framework overview