Forum Discussion
Referencing notebook exit value as a variable in a data pipeline
- 2 years ago
For my own implementation the delimited string just wasnt flexible enough - so here's a version using a JSON object as the notebook return value:
Notebook pyspark:
lResult={"numUpdated":10,"message":"success","fruit":["apple","orange","grapes"]} mssparkutils.notebook.exit(str(lResult))Expression for varMessageStr:
Anonymous(activity('Test Notebook').output.result.exitValue).messageExpression for varNumUpdatedInt:
INT(json(activity('Test Notebook').output.result.exitValue).numUpdated)Expression for varFruitArray:
Anonymous(activity('Test Notebook').output.result.exitValue).fruit
Hi Ostrzak
We can pass multiple parameters from Notebook to a pipeline using list of parameters. I have attached the screenshots along with the steps for your reference.
1) Create a list of parameters inside a notebook.
2) Using notebook and set variable activites we can pass the parameters to a pipeline.
I hope this information is helpful. Please do let us know if you have any questions.
Thank you for your answer. I got to that point independently but I can't parse the exit value so that I get several independent variables out of it. It would be great to know how to tackle that problem.
Additionally, is there a more advanced documentation for expression builder? I found this page and it's pretty fine, but it doesn't go beyond the functions listed in the builder. Even the expression I used in Set Variable (see my second post) was found through trial and error, after an extensive web search; it was not efficient.
Thank you in advance for any help.
- jwinchell401 year ago
Resolver III
Ostrzak - This request is really similiar to one I replied to a few months back. (https://community.fabric.microsoft.com/t5/Data-Pipeline/Use-Notebook-Variable-in-Email-Activity/m-p/3973679#M3786)
If you send back a JSON object you can convert the string in the pipeline use @Json() and then reference values within the JSON object.
- @Json(activity(<activity_name>).output.result.exitValue).<property>
- v-cboorla-msft2 years ago
Microsoft Employee
Hi Ostrzak
Apologies for the delay in reply from our side. Did you got a resolution for this?
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .- v-cboorla-msft2 years ago
Microsoft Employee
Hi Ostrzak
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.- Ostrzak2 years ago
Helper II