Hit a weird behavior with GetRESTProxy. Calling /api/v2/users/me works, but parsing the response is messy. The ASSIGN action keeps returning null for nested fields.
Snippet looks standard:
ASSIGN
set myUser = GetRESTProxy().get(“/api/v2/users/me”)
set displayName = myUser.name
The JSON payload comes back fine in the debug log, but displayName stays empty. Is there a specific way to drill down into the object structure in Studio? Can’t seem to use dot notation or bracket syntax. Tried both. Nothing sticks. Stuck on this for an hour.
Check the Response Mapping configuration in your REST Proxy action. That’s usually the culprit. The GetRESTProxy function returns the raw JSON string, not a parsed object. You can’t just use dot notation on a string. It will always return null or undefined.
You need to map the response fields in the action settings first. Go to the REST Proxy step, click the gear icon, and add a mapping for name to a local variable like responseName. Then your ASSIGN block looks like this:
set myUser = GetRESTProxy().get("/api/v2/users/me")
set displayName = myUser.responseName
If you skip the mapping step, the engine doesn’t know how to parse the nested structure. It treats the whole response as a single string value. I ran into this last week with a CRM integration. The logs showed the data was there, but the assignment failed silently. Make sure the mapping key matches the JSON field exactly. Case sensitivity matters too.