
i want to access some data when a user create a document and also when a user delete a document
when I log out this output log({"eventTriggered": JSON.stringify(req.body)});
i get the following
so now when i try to access the individual object let says postType
it log out empty as though nothing is inside,
so i decided to use JSON.parse(req.body)
i got the following errors
at JSON.parse (<anonymous>)
at Module.default (file:///usr/local/server/src/function/src/main.js:24:28)
at execute (/usr/local/server/src/server.js:141:48)
at async /usr/local/server/src/server.js:158:13```
Please, what i'm i doing wrong??

How are you trying to access the data?

i have resolved it
i change the JSON.stringify(req.body)
to JSON.parse(req.bodyRaw)
and it fixed it

[SOLVED] Can't Access Data in the response payload when Function is trigger
Recommended threads
- Unable to create push providers - FCM or...
Currently unable to create a push provider for FCM or APNS.... https://github.com/appwrite/console/issues/2045 When uploading a file... FCM = Valid file retu...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
