Forum Discussion

big_ozzie's avatar
big_ozzie
Copper Contributor
Feb 23, 2024

How to name Case in Switch activity using Get Metadata output

I have a Get Metadata activity in Azure Data Factory with "Structure" specified in the Field List. I then have a Switch activity with this expression: 

 

@activity('Get Metadata1_copy1').output.structure

 

An example evaluation of this expression, according to https://learn.microsoft.com/en-us/azure/data-factory/control-flow-get-metadata-activity, is: 

 

[
    {
        "name": "id",
        "type": "Int64"
    },
    {
        "name": "name",
        "type": "String"
    }
  ]

 

 

The issue is I cannot use this output to name a case in a switch activity. Trying with my own structure, I receive this error:

 

Pipeline name cannot be 'CasePipelineSwitch1[ { "name": "Athlete", "type": "string" }, { "name": "Date", "type": "String" }, { "name": "Team", "type": "string" }, { "name": "Time", "type": "string" }, { "name": "Time (sec)", "type": "string" }, { "name": "VIFT (km/hr)", "type": "string" }, { "name": "VIFT (m/s)", "type": "string" } ]'. Pipeline name should start and end with letter, number or underscore (_). Pipeline name has exceeded the limit of 140. Pipeline name should only contain letters, numbers, dashes (-), underscores (_), or spaces.

 

Here is a pic of my case name:

How do I name the case? Thanks

1 Reply

  • big_ozzie  The error message you received indicates that the pipeline name you provided exceeds the allowed length and contains invalid characters.

     

    You can create a pipeline name like this:

     

    CasePipelineSwitch1_Athlete_Date_Team_Time_TimeSec_VIFT_kmhr_VIFT_ms

     

    Note: Pipeline names start and end with letters, numbers, and dashes (-) or underscore (_). The maximum length for a pipeline name is 140 characters.

     

    You can read more about https://learn.microsoft.com/en-us/azure/data-factory/control-flow-switch-activity?WT.mc_id=%3Fwt.mc_id%3Dstudentamb_357518 

    and https://learn.microsoft.com/en-us/azure/data-factory/control-flow-get-metadata-activity?WT.mc_id=%3Fwt.mc_id%3Dstudentamb_357518

     

    If this post is helpful, please give my response a thumbs up! You can also mark it as the solution to help others find it easily.

     

    Thanks

Resources