Home  /  Questions  /  Question



50   50
Mar 28, 2016


Spark -- Expand Rest Object

Hi All,

I've searched the communities all weekend and read the documentation, but still can't get the "expand='querystring'" parameter to work in my call...

I have 2 examples that I thought I could get to work and neither one seems to be working....

Example 1)
Table A - Id, TableBId
TableB - Id, Name

When I call my rest endpoint for TableA, I'd like it to return the "Name" from TableB.

Example 2)
TableA - Id
TableB - Id, Name

When I call my rest endpoint for TableA, I'd like it to return a LIST of Names from TableB.

I've made sure that I've got all my foreign key references setup and when Spark generates the code it matches up to the documentation, but I'm just not sure if I need to add additional code to my controllers or if I'm using the wrong query string parameter.

Thanks for all your help!



508   99.9
Apr 04, 2016
Without knowing exactly what you are doing, I would place a breakpoint in the relevant Web API method.

Then invoke the Web API method and see if
   
   1) the database query returns what you expect, and
   2) see what the Web API method returns to the calling client.  

Hope this gets you started.