Forum Discussion

Rutuja1997's avatar
Rutuja1997
Frequent Visitor
1 year ago
Solved

Expression of type: 'String' does not match the field: 'folderPath'. Expected type is 'object'.

Hi Microsoft folks,

I am building a pipeline to copy the latest folder to the lakehouse from SFTP server.It could copy the folder when i entered the folder path manually but couldn't when I passed the folderpath dynamically using the concat function.Hardcoded path for example is '/Directory_name/folderName' .Now i want to dynamically pass the folderName from the the previous filter activity output which is filtering the latest folder.In the pipeline expression builder I wrote '

@concat('Directory_name/',activity('Filter1').output.Value[0].name).But getting "Expression of type: 'String' does not match the field: 'folderPath'. Expected type is 'object'." error.
I need this logic to build incremental pipeline to get the latest folder in the lakehous.
This is the filter activity payload {
"ItemsCount": 6,
"FilteredItemsCount": 1,
"Value": [
{
"name": "New_Extract_2*****64_1*************",
"type": "Folder"
}
]
}
 

 

  • v-aatheeque's avatar
    v-aatheeque
    1 year ago

    Hi Rutuja1997,
    Based on the error " Double quoted string is not allowed"
    Expression of type: 'String' does not match the field: 'folderPath'. Expected type is 'object.

    can you try the below path :

    {
      "folderPath": @concat('Directory_name/', activity('Filter1').output.Value[0].name)
    }
    


     

    If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

  • Hi Fabric Community,

    Apologies for late feedback.The issue was solved by using set variable activity.I stored the concatenated string in set variable and passed that in the folder path.That way i could solve that problem.

     

     

     

8 Replies

  • Try this

     

    {
    "folderPath": "@concat('Directory_name/', activity('Filter1').output.Value[0].name)"
    }

    • Rutuja1997's avatar
      Rutuja1997
      Frequent Visitor

      Hi Nilendra, Thank you for replying promptly.I tried above suggestion it didn't work.It is showing 

      I tried this way as well didn't work 

       

      • v-aatheeque's avatar
        v-aatheeque
        Community Support

        Hi Rutuja1997,
        Based on the error " Double quoted string is not allowed"
        Expression of type: 'String' does not match the field: 'folderPath'. Expected type is 'object.

        can you try the below path :

        {
          "folderPath": @concat('Directory_name/', activity('Filter1').output.Value[0].name)
        }
        


         

        If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

  • Rutuja1997's avatar
    Rutuja1997
    Frequent Visitor

    Hi Fabric Community,

    Apologies for late feedback.The issue was solved by using set variable activity.I stored the concatenated string in set variable and passed that in the folder path.That way i could solve that problem.

     

     

     

  • Doesn't work when referencing Variable Library values either. Despite the warning messages the pipeline will save and copy activity does work. It is however, disconcerting that the copy activity shows these errors. 



    If I use a Set Variable activity and concat the two values and use that in the copy activity. I don't see the error.

    In the Set Variable activity:

    @concat(pipeline().libraryVariables.Files_Temp_Path, '/', pipeline().libraryVariables.Files_Temp_Filename)

    and in the Copy Data activity:
    @variables('FilePath')