Moralis Cloud Run ReactJs Result

How can I accress the key=>value pairs from the Cloud.Run result?

Here’s an example:

const Result = await Moralis.Cloud.run("GetList");
console.log(JSON.stringify(Result));
console.log(Result);

// It looks ok with Stringify
{"createdAt":"2022-06-28T15:54:00.879Z","updatedAt":"2022-06-28T16:05:54.315Z","Logo":"test.png","objectId":"SKHum0ttj1avVm4HYNxLP0Md"}

I’ve tried Result[“createdAt”] and Result.createdAt without success.

There is a way to do it, it could be with .get

You can also use stringify and then parse the string again in an object

1 Like

I’ve just tried

  const Data = JSON.parse(JSON.stringify(Result));

and it works.

1 Like