Skip to main content

useCADataverseTaskManager

@spartanfx/react v1.2.2


@spartanfx/react / codeapps / useCADataverseTaskManager

Function: useCADataverseTaskManager()

function useCADataverseTaskManager(config): UseSharePointTaskManagerReturn;

Power Apps Code Apps TaskManager hook backed by a Dataverse table.

Configuration

Required

PropertyTypeDescription
fieldMappingITaskFieldMappingField mapping from internal task fields to Dataverse column logical names. There are no defaults for Dataverse because the publisher prefix (e.g. cr1a3_) is consumer-specific. Example fieldMapping: { title: 'cr1a3_title', description: 'cr1a3_description', dueDate: 'cr1a3_duedate', assignedTo: 'cr1a3_assignedto', // lookup column logical name status: 'cr1a3_status', // choice column }
idColumnstringLogical name of the primary key column on the task table. Typically <entity>id, e.g. cr1a3_taskid.

Options

PropertyTypeDescription
assigneeEntitySet?stringPlural entity set name for the assignee target entity, used to build the @odata.bind path on create/update. Optional — when omitted, the target table is discovered automatically from the assignee lookup's ManyToOneRelationships metadata (e.g. systemusersystemusers). Set this only to override that discovery, e.g. when the lookup points at a custom table with an irregular plural entity-set name.
assigneeService?unknownGenerated service for the assignee lookup's target table (the table the lookup points at — e.g. SystemusersService). When provided, the built-in people-picker reads candidate rows from it with getAll, using the table's primary name/id columns. This is the Microsoft-sanctioned way to read a Dataverse lookup's possible values: the related table must be added as a data source (pac code add-data-source -a dataverse -t systemuser), which generates the service you pass here. The service's table is verified against the lookup's actual target (from metadata) before use — a mismatch is logged and ignored so a row id from the wrong table can never be bound. Omit it to rely on onGetUserSuggestions (full control) or the built-in fallback that suggests assignees already present in the loaded tasks. Example import { SystemusersService } from './generated/services/SystemusersService'; useCADataverseTaskManager({ service: Ps_tasksService as never, assigneeService: SystemusersService, idColumn: 'ps_taskid', fieldMapping: { …, assignedTo: 'ps_assignedto' }, });
orderColumn?stringColumn used for $orderby on getAll. Optional — when omitted, the connector returns server-default order.

Events & callbacks

PropertyTypeDescription
resolveAssignee?(loginName) => Promise<string>Optional resolver mapping a login name / UPN / email to the Dataverse primary key (GUID) of the corresponding row in the assignee table. Example resolveAssignee: async (upn) => { const result = await SystemUsersService.getAll({ filter: internalemailaddress eq '${upn.replace(/'/g, "''")}', select: ['systemuserid'], top: 1, }); return result.data?.[0]?.systemuserid; }

+ 11 inherited members. standard HTML/ARIA attributes (e.g. className, onClick, aria-*) are also accepted but omitted here for clarity.

Full type reference: IUseCADataverseTaskManagerConfig

Returns

UseSharePointTaskManagerReturn