Parse.Cloud.afterSave(“List”, async (request) => {
let data = request.object;
console.log(“Object.keys(data) :”, Object.keys(data)); // returns [ ‘_objCount’, ‘className’, ‘id’ ] // 1. But why? Shouldn’t it return the columns (keys) from the class “List”
var array = Object.keys(data);
for (var i = 0; i < array.length; i++) {
console.log(“value :”, await data.get(array[i])); // returns undefined // 2. Why? How else to access the data for the object for which the afterSave function has been triggered?
});
@dblythy Thanks for your response. That does help!
Although, request.object.attributes seems to be excluding the “objectId” field.
Is there a workaround for that?
PS: i couldn’t any information regarding “attributes” or the other solution that i found (request.object.toJSON() ) anywhere in any of the documentation. Would have saved me a day of headache. How can i or someone else add this information in the documentation as well?