Pass Job ID dynamically in Azure Data Factory's Web activity

I am working on Salesforce Bulk API where I am able to Create Job and upload data to Salesforce successfully. Now I want to send a GET request to Salesforce and get job status but in URl field of web activity I am trying to pass the JOB ID from previous web activity and it is not working since Salesforce converts its 15 digit ID to 18 digit ID when it sends it over to Azure Data Factory. I am trying to contcat the url along with the Job ID but at the same time strip the last 3 characters.

ex: URL: JOBID: 01fr6745gh00000AAF (dynamically add this from previous activity, '')

Output I want: I want to pass this in the Web activity URL field.

I am not sure if this is possible or how to achieve this. Any help will be much appreciated.


1 answer

  • answered 2021-04-08 05:35 Steve Zhao

    You can use length() function to get your id's length, then use substring(id,0,length-3) function to get your expected id. Finally concat your URL and id.

    Something like this expression:

    @concat(' ',substring(activity('name'),0,sub(length(activity('name'),3)))