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"
latimeria
2 years agoSolution Specialist
Hello Anonymous ,
try by replacing _ with r
#"FilterColumnTable" = Table.SelectRows(tblColumn,(r)=> Record.Field(r,ProjectNo)),Anonymous
2 years agoNot applicable
(ProjectNo as text, tblColumn as table)=>
let
// #"FilterColumnTable" = Table.SelectRows(tblColumn, each Record.Field(_,ProjectNo)),
#"FilterColumnTable" = Table.SelectRows(tblColumn, (r) => Record.Field(r,ProjectNo)),
DatabaseName = "abc",
ObjectType = "rooms",
Proj =
Json.Document(
Web.Contents(
"https://api-us.drofus.com/api/",
[
RelativePath= DatabaseName & "/" & ProjectNo & "/" & ObjectType & "?$select=room_function_0_no,room_function_0_name,room_function_1_no,room_function_1_name,room_func_no,name,description,architect_no,programmed_area,designed_area,rds_status"
]
)
)
in
Proj
Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression?
Am I missing the 'each'