question

ewinkiser avatar image
0 Votes"
ewinkiser asked NandanHegde-7720 commented

Removing periods from URL in a REST CALL in ADF (Variable Activity)

Good morning all! @MarkKromer-MSFT @nasreen-akter @MartinJaffer-MSFT @KranthiPakala-MSFT

I am having trouble with the Remove Expression in my ADF Pipeline (Variable Activity)...What I need to do is get rids of the periods in the following URL

121220-image.png

Also in the following property in the Body of my REST CALL

Actually the following Variable contains the value with the periods, so this variable I want to remove these periods. @item().costNumber

121177-image.png

121176-image.png

Can anyone please assist?
Thanks so much!
Mike


azure-data-factory
image.png (3.7 KiB)
image.png (1.7 KiB)
image.png (51.3 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hey @ewinkiser ,
Did the below solution answer your query ?

0 Votes 0 ·

Hey @ewinkiser ,
Did the below solution resolved your query?

0 Votes 0 ·

1 Answer

NandanHegde-7720 avatar image
0 Votes"
NandanHegde-7720 answered

Hey,
You can use a combination of split, last and replace functions.

 {
     "name": "pipeline12",
     "properties": {
         "activities": [
             {
                 "name": "Set variable1",
                 "type": "SetVariable",
                 "dependsOn": [],
                 "userProperties": [],
                 "typeProperties": {
                     "variableName": "NewTest",
                     "value": {
                         "value": "@last(split(variables('Test'),'/'))",
                         "type": "Expression"
                     }
                 }
             },
             {
                 "name": "Set variable2",
                 "type": "SetVariable",
                 "dependsOn": [],
                 "userProperties": [],
                 "typeProperties": {
                     "variableName": "RidOfTest",
                     "value": {
                         "value": "@replace(variables('Test'),last(split(variables('Test'),'/')),'')",
                         "type": "Expression"
                     }
                 }
             }
         ],
         "variables": {
             "Test": {
                 "type": "String",
                 "defaultValue": "https://ustest60-ser.com/spi/v1/1.10"
             },
             "NewTest": {
                 "type": "String"
             },
             "RidOfTest": {
                 "type": "String"
             }
         },
         "annotations": []
     }
 }
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.