Forum Discussion
Help with integrating parameters into String creation
Anonymous
I doubt you can add the parameter within the " " string.
Try add the entire authkey to the parameter, then you can just call out the parameter in the code e.g.
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years agoNot applicable
Anonymous - so I actually used the code below and it seems to work although I'm getting a new error stating "Formula.Firewall: Query 'CitrixCVADServiceLic' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination." Now I did some research on this and found this but I don't believe that applies to my situation or, rather, I don't know how.
The "ChoiceBearerTokenGet" is a parameter that grabs the token .
let myBearerVariable = ChoiceBearerTokenGet, Date = Date.ToText(#date(Date.Year(DateTime.LocalNow()),Date.Month(DateTime.LocalNow()),Date.Day(DateTime.LocalNow())),"yyyy-MM"), myUrl = "https://licensing-eastus-release-b.citrixworkspacesapi.net/ChoiceSoluti/licenseusages/deployments/cloud/memberships/csp/products/cvad?date="&Date, myTokenHeader = "CwsAuth Bearer=" & myBearerVariable, myBody = "{ ""authorization"": """& myTokenHeader & """, ""content-type"": ""application/json"", ""Accept"": ""application/json"" }", Source = Json.Document( Web.Contents( myUrl, [ Headers = Json.Document(myBody) ] ) ), singleTenantsUsage = Source[singleTenantsUsage], #"Converted to Table" = Table.FromList(singleTenantsUsage, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"customerId", "orgId", "displayName", "editionName", "totalCommitCount", "totalUsageCount", "totalOverageCount", "totalUsagePercent"}, {"Column1.customerId", "Column1.orgId", "Column1.displayName", "Column1.editionName", "Column1.totalCommitCount", "Column1.totalUsageCount", "Column1.totalOverageCount", "Column1.totalUsagePercent"}), #"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"Column1.displayName", "Company"}, {"Column1.editionName", "sku"}, {"Column1.totalCommitCount", "totalCommitCount"}, {"Column1.totalUsageCount", "totalUsageCount"}, {"Column1.totalOverageCount", "totalFlexCount"}, {"Column1.totalUsagePercent", "totalUsagePercent"}, {"Column1.orgId", "CitrixCompanyorgId"}, {"Column1.customerId", "CitrixCustomerId"}}) in #"Renamed Columns"