Script equivalent of the "Convert to" feature?

Figured it out but leaving this up here for others reference.

Here is my script equivalent of the Convert to feature but with the ability to map to dissimilarly named fields.

const fibery = context.getService("fibery");

for (const entity of args.currentEntities) {
	await fibery.createEntity("Space B/Db Y", {
		"Person Name": entity["Name"],
		"Person Salary": entity["Salary"],
	});
    await fibery.deleteEntity(entity.type, entity.id);
}
7 Likes