Share via

data flow expr()

arkiboys 9,711 Reputation points
2021-11-11T20:21:23.417+00:00

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

148619-image.png

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


2 answers

Sort by: Most helpful
  1. Govind Sharma 6 Reputation points
    2022-09-30T19:03:56.367+00:00

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

    Please help.

    Was this answer helpful?

    0 comments No comments

  2. svijay-MSFT 5,256 Reputation points Microsoft Employee Moderator
    2021-11-17T08:09:36.903+00:00

    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 https://learn.microsoft.com/en-us/answers/questions/617827/index.html )

    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 :

    150015-image.png

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

    Now for each Row (within foreach activity),

    150103-image.png

    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)

    150030-image.png

    This is the Set Variable of the FinalExprr

    150017-image.png

    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)

    150122-image.png

    For instance, if your table had the below row

    table1.csv,value,upper

    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.

    150082-image.png

    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

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.