Hello everyone, and happy almost Thanksgiving!
I am working on a project in Power Query and need advice as to how I should pass a variable in my URL. The URL is for free access to an API that allows 100 combined request/day.
The original URL has a spot where a UPC code can be changed to lookup an item:
5010993689071
Currently, I have a list using Textjoin and I have gotten it to work somewhat. However, the URL I am using will only return two values at a time. So anything past the first two UPC codes does not get returned.
Would I be better off running some sort of loop that goes through the list one by one? If so, how would I do that? I am open to other solutions as well.
Thank you all so much!
I am working on a project in Power Query and need advice as to how I should pass a variable in my URL. The URL is for free access to an API that allows 100 combined request/day.
The original URL has a spot where a UPC code can be changed to lookup an item:
5010993689071
Currently, I have a list using Textjoin and I have gotten it to work somewhat. However, the URL I am using will only return two values at a time. So anything past the first two UPC codes does not get returned.
Power Query:
let
List=Excel.CurrentWorkbook(){[Name="UPCList"]}[Content]{0}[Column1],
Source = Json.Document(Web.Contents("https://api.upcitemdb.com/prod/trial/lookup?upc="&List&" ")),
items = Source[items],
#"Converted to Table" = Table.FromList(items, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"ean", "title", "description", "brand", "model", "color", "size", "dimension", "weight", "category", "currency", "lowest_recorded_price", "highest_recorded_price", "images", "offers", "elid"}, {"Column1.ean", "Column1.title", "Column1.description", "Column1.brand", "Column1.model", "Column1.color", "Column1.size", "Column1.dimension", "Column1.weight", "Column1.category", "Column1.currency", "Column1.lowest_recorded_price", "Column1.highest_recorded_price", "Column1.images", "Column1.offers", "Column1.elid"})
in
#"Expanded Column1"
Would I be better off running some sort of loop that goes through the list one by one? If so, how would I do that? I am open to other solutions as well.
Thank you all so much!