0 Replies Latest reply on Jan 29, 2012 8:33 AM by madhooper

    retrieve json response and setting property as a string

    madhooper Level 1

      While debugging I'm able to see the role returned in "responseData[0].role

       

      What's the easiest way to take that role i.e. "Manager" and put it in a variable as a String?

       

      I have the following result handler to retrieve a users role i.e. "Manager", "Supervisor", "User"

       

      private function onEntitlementResultHandler(event:ResultEvent):void

                          {

                                    var userRoleResponse:TaskResponse = new TaskResponse(JSON.decode(event.result as String));

                                    var responseData:Object = userRoleResponse.data;

                                    var userList:Object = responseData[0].role;

                                    model.userRole = userList as String;

                                    for each (var user:Object in userList)

                                    {

                                              user.role = model.userRole;

                                    }

       

                          }

       

      Thanks so much for your assistance.