Forum Discussion
Anonymous
2 years agoNot applicable
Record.Field(_, projNo) as parameter for a JSON Document Web Contents
I use the Json.Document(Web.Contents(....)) to request data. I created a function where I can extract the information for a single project using [projNo]="01" I have a separate table with the ...
- Anonymous2 years ago
Thank you latimeria, I figured out my issue. I was calling my function incorrectly!
Instead, I needed to Invoke Custom Function (Add Column tab) to call the function.
This is my solution:
= Table.AddColumn(Source, "getProjectURI", each getProjectURI([projNo], "rooms", #"101mapRooms"))I had tried to simplify the function but eliminated a key component as you noted:
#"FilterColumnTable"
Anonymous
2 years agoNot applicable
The correct function is this:
(ProjectNo as text, ObjectType as text, tblColumn as table) =>
let
#"FilterColumnTable" = Table.SelectRows(tblColumn, each ([ObjectType] = ObjectType)),
DatabaseName = "abc",
Proj =
Json.Document(
Web.Contents(
"https://api-us.drofus.com/api/",
[
RelativePath = DatabaseName & "/" & ProjectNo & "/" & ObjectType & "?$select=" & Text.Combine(#"FilterColumnTable"[dRofus.ID], ",")
]
)
)
in
Proj
This function requires two tables. Table1 invokes the function and has the index [projNo]. Table2 is the lookup (mapping) table that stores all of the fields for the API call. Table2 is referenced in the #"filterColumnTable"