data flow expr()

arkiboys 7,861 Reputation points

I am trying to pull the expression string from a cash table but error is:
Cannot evaluate constant value with this type
What am I doing wrong in the value expression?


Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
6,280 questions
{count} votes

2 answers

Sort by: Most helpful
  1. svijay-MSFT 5,111 Reputation points Microsoft Employee

    Hello @arkiboys ,

    Thanks for the question and using MS Q&A platform.

    I had checked internally, the below are possible :

    1. expr(‘String’)
    2. expr(String parameter) Note : This is presented in the video.

    expr(string returning function) – NOT SUPPORTED

    Now coming back to your scenario and considering your above constraints. (I am assuming this is a follow up query of what you had in this thread )

    I came with an alternative which may meet your requirement.

    You could pass the expression and table name as a parameter to the dataflow. Details of the implementation are below :


    You could do a lookup to the table (csv) - which contains the TableName, columnName, ApplyExpr

    Now for each Row (within foreach activity),


    I am setting the variable associated with each column so that I could process the TableName, columnName, ApplyExpr. (Note : You could also - directly used item().<value> - This is for convenience & not a mandate step)


    This is the Set Variable of the FinalExprr


    This basically does this transformation string operation - converts to Apply Expression and column name to necessary expression format that can be processed at the data flow end
    action(columname). (Note : If your transformation doesn't follow this format, you could do an if condition - format it as per each action. )

    You could pass the parameter to the dataflow - tableName and Final expression (this is combination of the columnName & ApplyExpr)


    For instance, if your table had the below row


    Then the parameter to the dataflow will be

    table : table1.csv
    expression : upper(value)

    Now inside the Dataflow , I am evaluating the parameter as an expression below.


    I am dynamically setting the source using the $table parameter.

    Hope this will help. Please let us know if you have any further queries.


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

  2. Govind Sharma 6 Reputation points

    Hi @arkiboys . Have you solved this problem. Today i am facing same problem. My requirement is same as your this requirement.

    Please help.

    No comments