Unable to access REST response data with 'returnObj' or 'actionResult'

I made a simple app that takes a Customer ID value entered by the user and executes a REST call on the Erp.BO.CustomerSvc GetByID operation. The call executes fine and I’m able to view the expected response structure when debugging, but I’m unable to figure out why I can’t access any of the response data using the ‘returnObj’ or ‘actionResult’ keys/views.

If I map the REST call response to a DataView I create, accessing the response data works perfectly fine using {View.Column} in subsequent event actions. But, whenever I try something like {returnObj.Customer.Name} or {actionResult.Name}, (both after ‘on-success’ for the rest-erp call), neither are recognized.

The actionResult DataView remains empty in the debugger following the REST call which I don’t understand. I thought this was because I had the response bound to the newly created DataView I made, but the results were the same even if I didn’t bind the response to any DataView. Since I couldn’t view or access the response with actionResult, I tried multiple variations of ‘returnObj’ syntax which was also unsuccessful. Being unable to access the response through ‘returnObj’ is more confusing to me.

My event structure, with dialog-show to display response values

The successful response:

Empty actionResult DataView after call is made:

My rest-erp widget setup:



To my understanding, shouldn’t all REST calls make returnObj and actionResult available to parse their response after on-success (with that response data being overwritten during future REST calls)? I’d like to know how to access these REST responses “on the fly” opposed to needing an attached DataView each time. Am I misinterpreting either of these terms?

1 Like

You can get the results to land in actionResult if you specifically tell them to go there:

This works:

I know actionResult is used automatically with function results… but I’ve only ever had success with BO rest calls when there is a named dataview to tell the system where to dump the results.

2 Likes

I guess I thought actionResult was automatically populated without having to declare it in View Name. Have you had success just using returnObj (without a DataView) to reference response data? I’m more confused as to why I haven’t been able to do that. I appreciate your help!

nope. I put together a few quick tests of various BO methods and the only thing that came back were parameters… not returnObj.

So, for example, if I did CustomerSvc.GetList… I could get the parameter of morePages to show up in actionResult. But the returnObj needs a named home (apparently).

1 Like

I’m curious how @datadaddy was able to use {returnObj.Customer.Checkbox01} in a condition widget following a rest-erp call here?

1 Like

My understanding is this:

If you want a rowset, you must populate View property of the rest-erp action with ‘actionResult’ or another view name.

If the View prop is blank, it assumes and auto-populates actionResult dataview but it only works (by-design) for responses having a simple property value.

So if you leave View blank and the request returns {“returnObj”: {“SOMEVALUE”}} it’ll try to set actionResult.returnObj = “SOMEVALUE” but it will never add rows to the dataview.

For rows, you must set View property.

2 Likes