This article is for the latest version of the Flatfile Data Exchange Platform.
It is! The Record Hook Plugin includes the event
parameter which can be used to gather context about the current space, including the spaceId. This can be used with the API to gather space-level metadata.
Example:
listener.use(
recordHook("Employees", async (record, event) => {
//grab spaceId from the event context
const spaceId = event.context.spaceId;
//grab space information
const meta = await api.spaces.get(spaceId);
//set variable from metadata
const userId = meta.data.metadata.user;
//use variable in recordHook
setLastName(record, userId);
return record;
})
);