Display Parse.com Cloud Code function results using mod_parse.

Hello,

I’m new to Corona and Lua. I made a Parse Cloud Code function that I was able to execute successfully using develephant’s mod_parse module: 

local function onRun( event ) if not event.error then print( event.response.value ) end end parse:run( "getPlayer", Params, onRun )

The code above, successfully executes my function which gets some values from a player ( not the current user ). In my Parse.com Logs, I’m able to see the “Result” from the execution. How can I display those values in Corona? Thank you :slight_smile:

Just posting this for any newbie out there who may need assistance regarding this question:

local function onRun( event ) if not event.error then local myNewText = display.newText( event.response.result[1].objectId, 100, 200, native.systemFontBold, 12 ) end end parse:run( "getPlayer", Params, onRun )

The code above will display in the Corona Simulator, the parse.com User ObjectId returned from the “getPlayer” Cloud Code function. If you are trying to display the username for example, then you would do event.response.result[1].username. I hope this helps.

Just posting this for any newbie out there who may need assistance regarding this question:

local function onRun( event ) if not event.error then local myNewText = display.newText( event.response.result[1].objectId, 100, 200, native.systemFontBold, 12 ) end end parse:run( "getPlayer", Params, onRun )

The code above will display in the Corona Simulator, the parse.com User ObjectId returned from the “getPlayer” Cloud Code function. If you are trying to display the username for example, then you would do event.response.result[1].username. I hope this helps.