Forum Discussion
DocumentDB Parameters
- Anonymous9 years ago
NielsDecoene,
How about changing query to the following?
DocumentDB.Contents(#####, [Query = "SELECT c.id AS Leverancier_ID, c.leverancier_naam AS Leverancier FROM c WHERE c.type = ""Leverancier"" AND c.project_id = """& Project & """"])
Regards,Lydia
So in my Advanced Editor i have the following:
let
parameterSource = (Project as text),
Source = DocumentDB.Contents(#####, [Query = "SELECT c.id AS Leverancier_ID, c.leverancier_naam AS Leverancier FROM c WHERE c.type = ""Leverancier"" AND c.project_id = ""& Project & """])
in
Source
Now i'm still getting an empty Table, i don't know if i did something wrong.
The parameter does get passed down as shown below
Thank you in advance
NielsDecoene,
Use the following code instead.
let
parameterSource = (Project as text) =>
let
DocumentDB.Contents(#####, [Query = "SELECT c.id AS Leverancier_ID, c.leverancier_naam AS Leverancier FROM c WHERE c.type = ""Leverancier"" AND c.project_id = ""& Project & """])
in
Source
in
parameterSource
Regards,
- NielsDecoene9 years ago
Helper I
I've done so accordingly, what once was a query now turned into a function.
http://prntscr.com/fhpcbmIf i type a correct value in the Project parameter and invoke it i'm getting an empty table.
Advanced Editor Code for the advanced editor:
let
Source = test("Project B")
in
Sourcewith test being the name of former query/currently function
Thx in advance
- Anonymous9 years agoNot applicable
Could you please show me the screenshot about the specific statement you use to connect to the Azure DocumentDB with static project( Project B)? Also show me the relevant code in Advanced Editor using screenshot.
Regards,
- NielsDecoene9 years ago
Helper I
Static Query Source overview as follows:
Static Query Advanced Editor:
let
Source = DocumentDB.Contents("https://selectieproject.documents.azure.com:443/", "selectieprojectDB", null, [Query = "SELECT c.id AS Leverancier_ID, c.leverancier_naam AS Leverancier FROM c WHERE c.type = ""Leverancier"" AND c.project_id = ""Project B"""]),
#"Expanded Document" = Table.ExpandRecordColumn(Source, "Document", {"Leverancier_ID", "Leverancier"}, {"Document.Leverancier_ID", "Document.Leverancier"})
in
#"Expanded Document"Hope this helps