---
id: reflect-apply
name: Reflect.apply
category: reflect
kind: namespace-method
tokens: Reflect.apply
sig: Reflect.apply(entity, value) -> int
tip: Write a value tree's fields back into an entity.
order: 14
ns: Reflect
member: apply
---
The inverse of Reflect.serialize: writes the fields of a value-tree value back into a live entity, and returns how many were set. Only components the entity already has and fields the schema knows are applied; reserved "@"-keys (like "@kind") and unknown names are skipped, so a partial or older save loads cleanly. Feed it the output of Json.parse to load a save.