useFields

useFields(
	options?: FieldsOptions, 
	deps?: any[]): IFieldInfo[] | null | undefined;

Returns field collection from web or list. Use FieldsOptions.list property to set target list.

Examples

Get web fields,

const webFields = useFields();

Get list fields,

const listFields = useFields({
	list: "5ee53613-bc0f-4b2a-9904-b21afd8431a7"
});

Query fields,

const listFields = useFields({
	list: "My List Title",
	query:{
		select: ["InternalName", "Title", "Id"]
	}
});

Parameters

NameTypeDescriptionTracked for changes
options?FieldsOptionsuseFields hook optionsPartially
deps?DependencyListHook dependency list.Yes