How do I save a scene into a json file?

I am working on a game sandbox like game where you can build and stuff but I don’t know how to save the scene when you start placing objects.

Create a object group, say named “AllSaveableObjects”.

When you want to save, use the “Repeat for each object” event, using the “AllSaveableObjects” as the object. You can then put each object’s details (name, position, rotation, scale etc.) into a structure, and then save the structure in JSON format.

Can you show me an example?