Odata - get data from table specified in Excel cell

Rainbows8

New Member
Joined
Apr 21, 2014
Messages
12
Hi Guys,

I am working with pulling data from Odata and choosing a specific table. I want to make the table it pulls from dynamic.
I want to be able to use a cell in Excel (e.g. A2) to store the name of the table.
Then I want the Excel query to include the cell reference.
So that, when I change the name of the table in A2, the query is automatically updated.
Any ideas? :)

Example of the Query:

let
Source = OData.Feed("https://********.svc"),
#"tablename_table" = Source{[Name="[B][COLOR=#FF0000]tablename[/COLOR][/B]",Signature="table"]}[Data]
in
#"tablename__table"
 
Not too familiar with Odata, but that shouldn't matter.

1. Give your cell in Excel a range name
2. Open a new blank query and type

Code:
=[COLOR=#000000][FONT=Consolas]Excel.CurrentWorkbook()[/FONT][/COLOR]

3. You should see your range name in the list of objects. Click the green table next to it which should create a 1x1 table with your table name in it.
4. Right click in the header of the column and select "drill down". This will convert your table into a one item list.
5. Rename the query MyList
6. I think you can use a one item list in place of text, in which case you can just type MyList in place of "tablename" in your code. If I remember incorrectly then MyList{0} instead.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top