init

Used to initialize the component instance. Components can kick off remote server calls and other initialization actions. Data-set values cannot be initialized here, use the updateView method to achieve that.

Available for

Model-driven apps and canvas apps (experimental preview)

Syntax

init(context,notifyOutputChanged,state,container)

Parameters

Parameter Name Type Required Description
context Context yes The Input Properties containing the parameters, component metadata and interface functions.
notifyOutputChanged function no The method to notify the framework that it has new outputs
state Dictionary no The component state that is saved from setControlState in the last session
container HTMLDivElement no The div element to render

Example

MyNameSpace.JSHelloWorldControl.prototype.init = function (context, notifyOutputChanged, state, container) {
	this._labelElement = document.createElement("label");
	this._labelElement.setAttribute("class", "JS_HelloWorldColor");
	container.appendChild(this._labelElement);
};

Control
PowerApps component framework API reference
PowerApps component framework overview