useAttachments

useAttachments(
	itemId: number,
	list: string,
	options?: ItemAttachmentsOptions,
	deps: any[]): IAttachmentInfo[] | null | undefined;

Returns all attachments from an item.

Examples

Get all attachments from an item,

const attachments = useAttachments(10, "My List");

Query list items attachments,

const filteredAttachments = useAttachments(10, "5ee53613-bc0f-4b2a-9904-b21afd8431a7", {
	query: {
		select: ["Name", "Id"],
		filter: "substringof('.pdf', Name) eq true"
	}
});

Parameters

NameTypeDescriptionTracked for changes
itemIdnumberList item IDYes
liststringTarget list UUID or titleYes
options?ItemAttachmentsOptionsuseAttachments hook optionsPartially
deps?DependencyListHook dependency list.Yes