I have 2 pipelines that are currently selected based on an IF condition, which works well. I now need to add a third pipeline , so using a Switch block instead. And instead of tablename as the deciding factor, ideally I would use logic something like this:
- does the sourcetablename value contain {FromDate} then goto pipeline A
- does the sourcetablename value contain {passinid} then goto pipeline B
- else goto pipeline C
The sourcetablename value comes with the initial gettablestoload lookup.
An example sourcetablename value is used for the API call in this instance, and would look like this for example: blahblah/content/{passinid}/user/blahblah
I am struggling with the expression for the switchblock. Previously I have matched on the last 10 characters of the tablename, this just seems a little bit tricky.
Here is an example of an expression to remove the last 46 characters, just to give you an idea where I am struggling up to:
@substring(activity('GetTablesToLoad').SourceTableName,0,sub(length(activity('GetTablesToLoad').SourceTableName),46))
Would anyone have an idea please?
If this was SQL it would be something like this:
DECLARE @text VARCHAR (500) = 'content/{passinid}/user'
SELECT SUBSTRING(@Text, CHARINDEX('{', @Text)
, CHARINDEX('}',@text) - CHARINDEX('{', @Text) + Len('}'))
thankyou