<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trigger Pipeline for decrypted SFTP file - Switch broken on evaluating part of filename in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Trigger-Pipeline-for-decrypted-SFTP-file-Switch-broken-on/m-p/4412417#M7091</link>
    <description>&lt;P&gt;Your Switch activity has not the right values. One of the potential issues is that how the FileName parameter is passed or split. These are some of the things that you should test:&lt;BR /&gt;&amp;nbsp;1. Make Sure the Filename is Actually Being Captured&lt;BR /&gt;Before the Switch activity, it is important to prove that the FileName parameter is assigned properly. Add a new Set Variable activity directly before the switch and write this:&lt;BR /&gt;&lt;BR /&gt;@activity('Get List of Files').output.childItems[0].name&lt;BR /&gt;Then, execute the pipeline in Debug mode and check whether the file name appears as you expect.&lt;BR /&gt;2. Fix the Split Expression in Switch Activity&lt;BR /&gt;Right now, you are using:&lt;BR /&gt;&lt;BR /&gt;split(pipeline().parameters.FileName, '_')[1]&lt;BR /&gt;The problem may be the file name as it may be loaded with a blank space causing the Switch to not match any cases. Adding a trim function will remove the spaces as well as other blank characters.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;trim(split(pipeline().parameters.FileName, '_')[1])&lt;BR /&gt;Otherwise, if you’re concerned about having the wrong case, change it to lowercase explicitly:&lt;BR /&gt;&lt;BR /&gt;toLower(trim(split(pipeline().parameters.FileName, '_')[1]))&lt;BR /&gt;This should make sure that the value matches with the case statements (Apple, Peaches, Pumpkin, etc.) exactly.&lt;BR /&gt;3. Double-Check the "Get List of Files" Output&lt;BR /&gt;During the process, go to the Debug output and check the following:&lt;BR /&gt;Are the filenames the correct ones that come back from it?&lt;BR /&gt;Do I need to loop through the files with a ForEach activity in case of multiple files?&lt;BR /&gt;The output may be completely empty, and the problem must have started from it!&lt;BR /&gt;4. Quick Fix for the Delete Activity&lt;BR /&gt;Despite the Switch not being able to match any folder, the file is removed anyway. It this behavior doesn’t match your expectation, a condition could be added before the Delete activity to check the right status which is true.&lt;BR /&gt;&amp;nbsp;Next Steps&lt;BR /&gt;&amp;nbsp;Add a Set Variable activity before the Switch → Print FileName in Debug&lt;BR /&gt;Fix the Split expression in the Switch&lt;BR /&gt;&amp;nbsp;Check the Debug output of “Get List of Files”&lt;BR /&gt;Confirm case-sensitivity and spaces in filenames&lt;/P&gt;</description>
    <pubDate>Sun, 16 Feb 2025 07:45:48 GMT</pubDate>
    <dc:creator>girishthimmaiah</dc:creator>
    <dc:date>2025-02-16T07:45:48Z</dc:date>
    <item>
      <title>Trigger Pipeline for decrypted SFTP file - Switch broken on evaluating part of filename</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Trigger-Pipeline-for-decrypted-SFTP-file-Switch-broken-on/m-p/4412249#M7089</link>
      <description>&lt;P&gt;Hello community - New to data factory.&amp;nbsp; This is probably a easy fix and would appreciate any insight.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;File hits SFTP folder, .Net application moves the file into a decryption folder and calls a trigger based on the folder.&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;The first step in the triggers is "get list of files" which has a dataset that is pointing to the decrypted folder&lt;UL&gt;&lt;LI&gt;The file path "File Name" box in the dataset currently does not contain any dynamic content and no parameters are defined for this dataset.&lt;/LI&gt;&lt;LI&gt;The "Get List of Files" settings are set with an argument of "Child Items" and contains a&amp;nbsp; User Property of "File Name" with value "@pipeline().parameters.filename&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;"Get List of Files" flows to "Switch 1"&lt;UL&gt;&lt;LI&gt;A pipeline Parameter exists which is called 'FileName', Type:&amp;nbsp; String, Default Value:&amp;nbsp;@pipeline().parameters.filename&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;No variables are set&lt;/LI&gt;&lt;LI&gt;No Settings were changed&lt;/LI&gt;&lt;LI&gt;No Output is shown&lt;/LI&gt;&lt;LI&gt;The "Expression" box contains:&amp;nbsp; "split(pipeline().parameters.FileName, '_')[1]&lt;UL&gt;&lt;LI&gt;the expression box with this text causes exceptions in the "Live View Telemetry "&lt;/LI&gt;&lt;LI&gt;the expression "@split(pipeline().parameters.FileName, '_')[1]" causes the pipeline to fail on the swtich&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Case 1 in the switch is a "Wait 1"&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Case 2-4 are&amp;nbsp; pipelines that execute on the characters in the file name:&lt;UL&gt;&lt;LI&gt;Format of the file name is ######_abcdefghijk_YYYYMMDDHHSS&lt;/LI&gt;&lt;LI&gt;The case statements contain characters after the first "_" for example -&amp;nbsp;&lt;UL&gt;&lt;LI&gt;Case 1:&amp;nbsp; Apple&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for file named&amp;nbsp; ######_Apple_2025mmdd...&lt;UL&gt;&lt;LI&gt;A pipeline is executed in each case and contains the following:&lt;UL&gt;&lt;LI&gt;Invoked Pipeline&amp;nbsp; "Apple"&lt;UL&gt;&lt;LI&gt;Contains Parameter : FileName, Type: String, Value: "&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Get List of Files'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;itemName"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Case 2:&amp;nbsp; Peaches&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for file named&amp;nbsp; ######_Peaches_2025mmdd...&lt;/LI&gt;&lt;LI&gt;Case 3:&amp;nbsp; Pumpkin&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for file name ######_Pumpkin_2025mmdd.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;The Switch activity flows to a "Delete" activity&amp;nbsp;&lt;UL&gt;&lt;LI&gt;The delete activity uses the same dataset in the "Get List of Files" activity above&lt;/LI&gt;&lt;LI&gt;The file path type is "File Path in Dataset"&lt;/LI&gt;&lt;LI&gt;Recursively box is checked&lt;/LI&gt;&lt;LI&gt;No Logging setting&lt;/LI&gt;&lt;LI&gt;No User Properties&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Summary:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result of a file being dropped onto the SFTP server executes the .net program, the "Get List of Files" activity, the switch executes but does not find a match on the case so passes through to the delete which cleans up the decrypted file.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm totally lost and know it has something to do with the way its wired.&amp;nbsp; I need help and would be super appreciative of your wisdom.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2025 19:20:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Trigger-Pipeline-for-decrypted-SFTP-file-Switch-broken-on/m-p/4412249#M7089</guid>
      <dc:creator>boiler87</dc:creator>
      <dc:date>2025-02-15T19:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger Pipeline for decrypted SFTP file - Switch broken on evaluating part of filename</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Trigger-Pipeline-for-decrypted-SFTP-file-Switch-broken-on/m-p/4412417#M7091</link>
      <description>&lt;P&gt;Your Switch activity has not the right values. One of the potential issues is that how the FileName parameter is passed or split. These are some of the things that you should test:&lt;BR /&gt;&amp;nbsp;1. Make Sure the Filename is Actually Being Captured&lt;BR /&gt;Before the Switch activity, it is important to prove that the FileName parameter is assigned properly. Add a new Set Variable activity directly before the switch and write this:&lt;BR /&gt;&lt;BR /&gt;@activity('Get List of Files').output.childItems[0].name&lt;BR /&gt;Then, execute the pipeline in Debug mode and check whether the file name appears as you expect.&lt;BR /&gt;2. Fix the Split Expression in Switch Activity&lt;BR /&gt;Right now, you are using:&lt;BR /&gt;&lt;BR /&gt;split(pipeline().parameters.FileName, '_')[1]&lt;BR /&gt;The problem may be the file name as it may be loaded with a blank space causing the Switch to not match any cases. Adding a trim function will remove the spaces as well as other blank characters.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;trim(split(pipeline().parameters.FileName, '_')[1])&lt;BR /&gt;Otherwise, if you’re concerned about having the wrong case, change it to lowercase explicitly:&lt;BR /&gt;&lt;BR /&gt;toLower(trim(split(pipeline().parameters.FileName, '_')[1]))&lt;BR /&gt;This should make sure that the value matches with the case statements (Apple, Peaches, Pumpkin, etc.) exactly.&lt;BR /&gt;3. Double-Check the "Get List of Files" Output&lt;BR /&gt;During the process, go to the Debug output and check the following:&lt;BR /&gt;Are the filenames the correct ones that come back from it?&lt;BR /&gt;Do I need to loop through the files with a ForEach activity in case of multiple files?&lt;BR /&gt;The output may be completely empty, and the problem must have started from it!&lt;BR /&gt;4. Quick Fix for the Delete Activity&lt;BR /&gt;Despite the Switch not being able to match any folder, the file is removed anyway. It this behavior doesn’t match your expectation, a condition could be added before the Delete activity to check the right status which is true.&lt;BR /&gt;&amp;nbsp;Next Steps&lt;BR /&gt;&amp;nbsp;Add a Set Variable activity before the Switch → Print FileName in Debug&lt;BR /&gt;Fix the Split expression in the Switch&lt;BR /&gt;&amp;nbsp;Check the Debug output of “Get List of Files”&lt;BR /&gt;Confirm case-sensitivity and spaces in filenames&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 07:45:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Trigger-Pipeline-for-decrypted-SFTP-file-Switch-broken-on/m-p/4412417#M7091</guid>
      <dc:creator>girishthimmaiah</dc:creator>
      <dc:date>2025-02-16T07:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger Pipeline for decrypted SFTP file - Switch broken on evaluating part of filename</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Trigger-Pipeline-for-decrypted-SFTP-file-Switch-broken-on/m-p/4412554#M7093</link>
      <description>&lt;P&gt;Thank you for your detailed response!!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a different approach to the problem and setup a trigger on storage of the file from the .Net job on the Decrypted folder.&amp;nbsp; The trigger is on file appearing in the decrypted folder and then evulating the pipeline().paramater.filename in the switch without the need for getting metadata.&amp;nbsp; This has streamlined my approach.&lt;/P&gt;&lt;P&gt;Again, I very much appreciate you taking the time out of your busy day to provide me with your insight.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 11:43:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Trigger-Pipeline-for-decrypted-SFTP-file-Switch-broken-on/m-p/4412554#M7093</guid>
      <dc:creator>boiler87</dc:creator>
      <dc:date>2025-02-18T11:43:47Z</dc:date>
    </item>
  </channel>
</rss>

