@microsoft/power-apps package

Interfaces

IConfig
IContext
IOperationOptions

Base interface for operation options The parameters must be defined as OData query parameters

IOperationResult

Base interface for operation results

IDataOperationExecutor
GetEntityMetadataOptions
ILogger

Functions

getContext()
setConfig(IConfig)
deserializeMultiSelectPicklistFields(Record<string, unknown>, readonly string[])

Deserializes MultiSelectPicklist fields in a Dataverse record returned from the API.

The Dataverse Web API returns MultiSelectPicklist values as comma-separated strings (e.g. "100,200,300"), but the generated TypeScript types represent them as number arrays. This function mutates the record in place, converting each listed field from its wire format back to an array. An empty string ("") is treated as an empty array.

getClient(DataSourcesInfo)
serializeMultiSelectPicklistFields(Record<string, unknown>, readonly string[])

Serializes MultiSelectPicklist fields in a Dataverse record before sending to the API.

The Dataverse Web API expects MultiSelectPicklist values as comma-separated strings (e.g. "100,200,300"), but the generated TypeScript types represent them as number arrays (e.g. [100, 200, 300]). This function converts any listed field whose current value is an array into that wire format. An empty array is serialized as null because Dataverse rejects an empty string for this column type — null is the correct way to clear the field.

A shallow copy of the record is returned so the caller's object is not mutated.

createMockDataExecutor(MockDataStore<unknown>)
getAssociatedMenuBehaviorName(0 | 1 | 2)
getAssociatedMenuGroupName(0 | 1 | 2 | 3)
getAttributeRequiredLevelName(0 | 1 | 2 | 3)
getAttributeTypeCodeName(0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20)
getCascadeTypeName(0 | 1 | 2 | 3 | 4 | 5)
getEntityClusterModeName(0 | 1 | 2)
getOwnershipTypeName(0 | 1 | 2 | 4 | 8 | 16 | 32)
getPrivilegeTypeName(0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8)
getRelationshipTypeName(0 | 1)
getSecurityTypesName(0 | 1 | 2 | 8 | 16)
setDataOperationExecutor(IDataOperationExecutor)
initializeLogger(ILogger)

Function Details

getContext()

function getContext(): Promise<IContext>

Returns

Promise<IContext>

setConfig(IConfig)

function setConfig(config: IConfig)

Parameters

config
IConfig

deserializeMultiSelectPicklistFields(Record<string, unknown>, readonly string[])

Deserializes MultiSelectPicklist fields in a Dataverse record returned from the API.

The Dataverse Web API returns MultiSelectPicklist values as comma-separated strings (e.g. "100,200,300"), but the generated TypeScript types represent them as number arrays. This function mutates the record in place, converting each listed field from its wire format back to an array. An empty string ("") is treated as an empty array.

function deserializeMultiSelectPicklistFields(record: Record<string, unknown>, fields: readonly string[])

Parameters

record

Record<string, unknown>

The record returned by retrieveRecordAsync or retrieveMultipleRecordsAsync. Mutated in place.

fields

readonly string[]

Names of all MultiSelectPicklist columns declared on this entity.

getClient(DataSourcesInfo)

function getClient(dataSourcesInfo: DataSourcesInfo): DataClient

Parameters

dataSourcesInfo

DataSourcesInfo

Returns

serializeMultiSelectPicklistFields(Record<string, unknown>, readonly string[])

Serializes MultiSelectPicklist fields in a Dataverse record before sending to the API.

The Dataverse Web API expects MultiSelectPicklist values as comma-separated strings (e.g. "100,200,300"), but the generated TypeScript types represent them as number arrays (e.g. [100, 200, 300]). This function converts any listed field whose current value is an array into that wire format. An empty array is serialized as null because Dataverse rejects an empty string for this column type — null is the correct way to clear the field.

A shallow copy of the record is returned so the caller's object is not mutated.

function serializeMultiSelectPicklistFields(record: Record<string, unknown>, fields: readonly string[]): Record<string, unknown>

Parameters

record

Record<string, unknown>

The record being sent to createRecordAsync or updateRecordAsync.

fields

readonly string[]

Names of all MultiSelectPicklist columns declared on this entity.

Returns

Record<string, unknown>

A new record object with array-valued picklist fields replaced by comma-separated strings, or null for empty arrays.

createMockDataExecutor(MockDataStore<unknown>)

function createMockDataExecutor(data: MockDataStore<unknown>): MockDataOperationExecutor

Parameters

data

MockDataStore<unknown>

Returns

MockDataOperationExecutor

getAssociatedMenuBehaviorName(0 | 1 | 2)

function getAssociatedMenuBehaviorName(value: 0 | 1 | 2): "UseCollectionName" | "UseLabel" | "DoNotDisplay"

Parameters

value

0 | 1 | 2

Returns

"UseCollectionName" | "UseLabel" | "DoNotDisplay"

getAssociatedMenuGroupName(0 | 1 | 2 | 3)

function getAssociatedMenuGroupName(value: 0 | 1 | 2 | 3): "Details" | "Sales" | "Service" | "Marketing"

Parameters

value

0 | 1 | 2 | 3

Returns

"Details" | "Sales" | "Service" | "Marketing"

getAttributeRequiredLevelName(0 | 1 | 2 | 3)

function getAttributeRequiredLevelName(value: 0 | 1 | 2 | 3): "None" | "SystemRequired" | "ApplicationRequired" | "Recommended"

Parameters

value

0 | 1 | 2 | 3

Returns

"None" | "SystemRequired" | "ApplicationRequired" | "Recommended"

getAttributeTypeCodeName(0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20)

function getAttributeTypeCodeName(value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20): "String" | "Boolean" | "BigInt" | "Customer" | "DateTime" | "Decimal" | "Double" | "Integer" | "Lookup" | "Memo" | "Money" | "Owner" | "PartyList" | "Picklist" | "State" | "Status" | "Uniqueidentifier" | "CalendarRules" | "Virtual" | "ManagedProperty" | "EntityName"

Parameters

value

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20

Returns

"String" | "Boolean" | "BigInt" | "Customer" | "DateTime" | "Decimal" | "Double" | "Integer" | "Lookup" | "Memo" | "Money" | "Owner" | "PartyList" | "Picklist" | "State" | "Status" | "Uniqueidentifier" | "CalendarRules" | "Virtual" | "ManagedProperty" | "EntityName"

getCascadeTypeName(0 | 1 | 2 | 3 | 4 | 5)

function getCascadeTypeName(value: 0 | 1 | 2 | 3 | 4 | 5): "UserOwned" | "NoCascade" | "Cascade" | "Active" | "RemoveLink" | "Restrict"

Parameters

value

0 | 1 | 2 | 3 | 4 | 5

Returns

"UserOwned" | "NoCascade" | "Cascade" | "Active" | "RemoveLink" | "Restrict"

getEntityClusterModeName(0 | 1 | 2)

function getEntityClusterModeName(value: 0 | 1 | 2): "Partitioned" | "Replicated" | "Local"

Parameters

value

0 | 1 | 2

Returns

"Partitioned" | "Replicated" | "Local"

getOwnershipTypeName(0 | 1 | 2 | 4 | 8 | 16 | 32)

function getOwnershipTypeName(value: 0 | 1 | 2 | 4 | 8 | 16 | 32): "None" | "UserOwned" | "TeamOwned" | "BusinessOwned" | "OrganizationOwned" | "BusinessParented" | "Filtered"

Parameters

value

0 | 1 | 2 | 4 | 8 | 16 | 32

Returns

"None" | "UserOwned" | "TeamOwned" | "BusinessOwned" | "OrganizationOwned" | "BusinessParented" | "Filtered"

getPrivilegeTypeName(0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8)

function getPrivilegeTypeName(value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8): "None" | "Create" | "Read" | "Write" | "Delete" | "Assign" | "Share" | "Append" | "AppendTo"

Parameters

value

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8

Returns

"None" | "Create" | "Read" | "Write" | "Delete" | "Assign" | "Share" | "Append" | "AppendTo"

getRelationshipTypeName(0 | 1)

function getRelationshipTypeName(value: 0 | 1): "OneToManyRelationship" | "ManyToManyRelationship"

Parameters

value

0 | 1

Returns

"OneToManyRelationship" | "ManyToManyRelationship"

getSecurityTypesName(0 | 1 | 2 | 8 | 16)

function getSecurityTypesName(value: 0 | 1 | 2 | 8 | 16): "None" | "Append" | "ParentChild" | "Pointer" | "Inheritance"

Parameters

value

0 | 1 | 2 | 8 | 16

Returns

"None" | "Append" | "ParentChild" | "Pointer" | "Inheritance"

setDataOperationExecutor(IDataOperationExecutor)

function setDataOperationExecutor(dataOperationExecutorOverride: IDataOperationExecutor)

Parameters

dataOperationExecutorOverride
IDataOperationExecutor

initializeLogger(ILogger)

function initializeLogger(logger: ILogger): Promise<void>

Parameters

logger
ILogger

Returns

Promise<void>