locked
ADF Expression Issue RRS feed

  • Question

  • Hi,

    I don't know why, but I can't get his right.

    What I need to do as the first Activity in my pipeline is:

    "xxxx/12/Daily/MasterMerge"

    it can be prefixed with variable alpha-numerics

    What I need is the 12 (which stands for CompanyID, however it can be any number including 123 for example. and I don't need the rest of the statement. In other words I just need to pass the CompanyID (like 12 in the above case) to become a variable in my pipeline.

    Can you please assist? For me the difficult part is just getting the Company ID (again it can be any number from 1 to 999) when the values around it can be flexible?

    Thanks so much!
    Mike Kiser

    I'm attaching an actual Blob Screenshot used in my App.....


    Mike Kiser

    Friday, December 6, 2019 2:44 AM

Answers

  • What I need to do as the first Activity in my pipeline is:

    "xxxx/12/Daily/MasterMerge"

    it can be prefixed with variable alpha-numerics

    What I need is the 12

    If you want to get 12 from the input path as you have mentioned, you can use below expression:

    @split(pipeline().parameters.FolderPath,'/')[1]



    If the response helped, do "Mark as answer" and upvote it
    - Vaibhav

    Friday, December 6, 2019 6:06 AM

All replies

  • Expressions can appear anywhere in a JSON string value and always result in another JSON value. If a JSON value is an expression, the body of the expression is extracted by removing the at-sign (@). If a literal string is needed that starts with @, it must be escaped by using @@. The following examples show how expressions are evaluated.
    Friday, December 6, 2019 4:37 AM
  • What I need to do as the first Activity in my pipeline is:

    "xxxx/12/Daily/MasterMerge"

    it can be prefixed with variable alpha-numerics

    What I need is the 12

    If you want to get 12 from the input path as you have mentioned, you can use below expression:

    @split(pipeline().parameters.FolderPath,'/')[1]



    If the response helped, do "Mark as answer" and upvote it
    - Vaibhav

    Friday, December 6, 2019 6:06 AM
  • Wow, Chirag! Your knowledge is impressive! That is exactly what I was looking for!

    Thanks so much!!
    Mike


    Mike Kiser

    Friday, December 6, 2019 3:07 PM
  • Hi Vaibhav,

    Just curious...what tool are you doing to do the simulation above? I could use that in my documentation....

    Thanks
    Mike


    Mike Kiser

    Friday, December 6, 2019 4:12 PM
  • Hi Vaibhav,

    Just curious...what tool are you doing to do the simulation above? 

    ScreenToGif. It's free.

    If the response helped, do "Mark as answer" and upvote it
    - Vaibhav

    Friday, December 6, 2019 5:51 PM