useCASharePointDataForm
@spartanfx/react / codeapps / useCASharePointDataForm
Function: useCASharePointDataForm()
Call Signature
function useCASharePointDataForm<TRecord>(): UseCADataFormReturn;
Power Apps Code Apps SharePoint adapter for DataForm.
Type Parameters
TRecord
TRecord extends CADataFormRecord = CADataFormRecord
Returns
Call Signature
function useCASharePointDataForm<TRecord>(config): UseCADataFormReturn;
Power Apps Code Apps SharePoint adapter for DataForm.
Type Parameters
TRecord
TRecord extends CADataFormRecord = CADataFormRecord
Parameters
config
IUseCASharePointDataFormConfig<TRecord>
Returns
Configuration
Required
| Property | Type | Description |
|---|---|---|
service | ICATabularService<TRecord, string> | - |
Options
| Property | Type | Description |
|---|---|---|
autoRefresh? | boolean | Enable auto-refresh after mutations (default: true). |
cacheDuration? | number | Cache TTL for read results in ms (default: 60_000). |
choiceColumns? | string[] | - |
debug? | boolean | Enable verbose console logging (default: false). |
disabled? | boolean | - |
fieldInfo? | IDataTableFieldType[] | - |
fields? | IDataFormFieldDefinition<DataFormValues>[] | - |
idColumn? | string | - |
itemId? | string | - |
lookupServices? | Record<string, CADataverseLookupService> | Referenced-table data sources for Dataverse lookup columns, keyed by the lookup column logical name (e.g. ps_company). The navigation property, referenced entity logical name, or entity-set name are also accepted as keys. Required for Dataverse lookup fields to populate their options, since the owning form's service cannot query the referenced table. Ignored for SharePoint (which resolves options via getReferencedEntity). |
metadata? | unknown | - |
mode? | DataFormMode | - |
readonly? | boolean | - |
record? | TRecord | - |
retryPolicy? | ICARetryPolicy | Retry policy for transient failures. |
Events & callbacks
| Property | Type | Description |
|---|---|---|
onError? | (error) => void | Error callback. Called for every operational failure. |
onInit? | (dataFormContext) => void | Promise<void> | - |
onLoaded? | (record) => void | Promise<void> | - |
onNotify? | CANotifyFn | Notification callback. If omitted, hook errors surface via error state only. |
onSave? | (record, dataFormContext) => unknown | - |
onSaved? | (record) => void | Promise<void> | - |
Full type reference:
IUseCASharePointDataFormConfig