Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to pass a query with a pipeline parameter from a json. And passing the parameter while running the pipeline and the pipeline fails. below query:
Also, tried the below expression the copy activity query editor and still no luck. Any ideas appreciated.
-----------------------------------------------------------------
Solved! Go to Solution.
Hi @IAZ ,
Looks like you're trying to dynamically pass a pipeline parameter into your query string using a JSON config, but the expression isn't resolving as expected during runtime.
The issue is likely because you're trying to use @{pipeline().parameters.par1} inside a string that's already being evaluated by the @concat() function. When you nest expressions like that, especially inside JSON-driven queries, it can get tricky.
Instead of embedding the parameter directly in the JSON like this:
"query": "select * from CUSTOMER where OBJ > @{pipeline().parameters.par1}"
Try keeping the query in the JSON more generic, like:
"query": "select * from CUSTOMER where OBJ >"
Then in your copy activity, use something like:
@concat(item().source.query, ' ', pipeline().parameters.par1)
This way, you're appending the parameter value at runtime without trying to resolve nested expressions inside the JSON.
Let me know if you're still hitting issues, happy to help further.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
A follow up question:
@concat(item().source.query, ' ', pipeline().parameters.par1)
If I set the parameter "par1" as "int" (as the where sql clause needs an int instead of a string) the above expression gives the this message "cannot fit number into the function string list. any help would be greatly appreciated.
Brilliant...many thanks and really appreciate you help and guidance. It works ! And saved me loads of time. Thanks again.
Hi @IAZ ,
Looks like you're trying to dynamically pass a pipeline parameter into your query string using a JSON config, but the expression isn't resolving as expected during runtime.
The issue is likely because you're trying to use @{pipeline().parameters.par1} inside a string that's already being evaluated by the @concat() function. When you nest expressions like that, especially inside JSON-driven queries, it can get tricky.
Instead of embedding the parameter directly in the JSON like this:
"query": "select * from CUSTOMER where OBJ > @{pipeline().parameters.par1}"
Try keeping the query in the JSON more generic, like:
"query": "select * from CUSTOMER where OBJ >"
Then in your copy activity, use something like:
@concat(item().source.query, ' ', pipeline().parameters.par1)
This way, you're appending the parameter value at runtime without trying to resolve nested expressions inside the JSON.
Let me know if you're still hitting issues, happy to help further.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
User | Count |
---|---|
24 | |
17 | |
6 | |
5 | |
2 |
User | Count |
---|---|
49 | |
43 | |
18 | |
6 | |
5 |