Skip to main content

useCASharePointTaskManager

@spartanfx/react v1.2.2


@spartanfx/react / codeapps / useCASharePointTaskManager

Function: useCASharePointTaskManager()

function useCASharePointTaskManager(config): UseSharePointTaskManagerReturn;

Power Apps Code Apps TaskManager hook backed by a SharePoint list.

Consumes a generated SharePoint-list service produced by pac code add-data-source -a shared_sharepointonline -t <ListName> -d <siteUrl>.

Configuration

PropertyTypeDescription
choiceColumns?string[]Advanced hint for SharePoint reference columns. By default the hook handles status and assignedTo from the field mapping automatically. See: https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/sharepoint-operations
fieldMapping?ITaskFieldMappingSharePoint list field mapping. Defaults to the SharePoint Tasks list conventions (Title, Description, DueDate, AssignedTo, Status).
office365UsersService?unknownGenerated Office365UsersService connector service. When provided, the people-picker searches the directory via SearchUserV2 for richer, faster results, and only falls back to the SharePoint connector's getReferencedEntity when the directory search yields nothing. Add the connector with pac code add-data-source -a shared_office365users -c <connectionId>, which generates the service you pass here. The selected user's UPN/email is still resolved to the SharePoint person reference on write via getReferencedEntity. Example import { Office365UsersService } from './generated/services/Office365UsersService'; useCASharePointTaskManager({ service: TasksService as never, office365UsersService: Office365UsersService });

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

Full type reference: IUseCASharePointTaskManagerConfig

Returns

UseSharePointTaskManagerReturn

Example

import { TasksService } from './generated/services/TasksService';
import { useCASharePointTaskManager } from '@spartanfx/react/codeapps';

const taskManagerProps = useCASharePointTaskManager({
service: TasksService as any,
onNotify: (level, msg) => toast[level](msg),
});

return <TaskManager {...taskManagerProps} />;