Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
moizsherwani
Continued Contributor
Continued Contributor

Get Value From Web API Using Value From Column

Hey guys,

 

I need help with getting result back from a web api. The data which I need to pass to the api is stored in a column and I need a new column to be populated with the result from the web See the example below (BSID is what is available and Group is what I need to get from the Api using the URL https://api.macvendors.com/"BSID")

 

BSID - Group

FCA13E  -  Samsung Electronics Co.,Ltd

8841fc - AirTies Wireless Networks

 

Example of a call would be

https://api.macvendors.com/FCA13E

 

Thanks

 

Moiz

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.
6 REPLIES 6
v-jiascu-msft
Employee
Employee

Hi Moiz,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Dale,

 

Haven't found the proper solution as yet but also did not get time to look into it further.

 

Moiz

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

Could you provide us the raw data (1000s of rows) that you're looking to do this for?  Then we could hopefully help you get to a working solution.

ssugar
Resolver III
Resolver III

In the Query Editor, add a Custom Column (Add Column > Custom Column) with the following:

Csv.Document(Web.Contents("https://api.macvendors.com/" & [BSID]))

 

After that, you'll want to expand the column, then merge the column with "Space" as the separator, and finally rename the column to Group. 

 

My pbix file: https://github.com/ssugar/PowerBICommunity/raw/master/community-sol-279591.pbix

moizsherwani
Continued Contributor
Continued Contributor

This seems to work, the only issue I am having now is that the example was 2 rows whereas in reality there are 1000s of rows.

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

Shouldn't be a problem running this against 1000s of rows.  I've run something similar across tens of thousands of rows.  The main potential issue you'll face is rate limiting from the API.    If you run into something like that, try this:

https://blog.crossjoin.co.uk/2015/04/30/using-function-invokeafter-in-power-query/

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.