{ "name": "Get latest files_dateInFilename", "properties": { "activities": [ { "name": "Get all the file from the folder", "type": "GetMetadata", "dependsOn": [], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": false, "secureInput": false }, "userProperties": [], "typeProperties": { "dataset": { "referenceName": "DelimitedText7", "type": "DatasetReference" }, "fieldList": [ "childItems" ], "storeSettings": { "type": "AzureDataLakeStoreReadSettings" }, "formatSettings": { "type": "DelimitedTextReadSettings" } } }, { "name": "Loop through all the file", "type": "ForEach", "dependsOn": [ { "activity": "Get all the file from the folder", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "items": { "value": "@activity('Get all the file from the folder').output.childItems", "type": "Expression" }, "isSequential": true, "activities": [ { "name": "Set variable1", "type": "SetVariable", "dependsOn": [], "userProperties": [], "typeProperties": { "variableName": "filename", "value": { "value": "@item().name", "type": "Expression" } } }, { "name": "If Condition1", "type": "IfCondition", "dependsOn": [ { "activity": "DatewExtract_fromFileName", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "expression": { "value": "@greater(int(variables('DatewExtract_fromFileName')),int(variables('TakeAnyStartDate')))\n", "type": "Expression" }, "ifTrueActivities": [ { "name": "Get The Filename", "type": "SetVariable", "dependsOn": [ { "activity": "Set variable2", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "variableName": "GetLatestFileName", "value": { "value": "@item().name", "type": "Expression" } } }, { "name": "Set variable2", "type": "SetVariable", "dependsOn": [], "userProperties": [], "typeProperties": { "variableName": "TakeAnyStartDate", "value": "@substring( variables('filename') ,indexof(variables('filename'),'2') ,8 )" } } ] } }, { "name": "DatewExtract_fromFileName", "type": "SetVariable", "dependsOn": [ { "activity": "Set variable1", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "variableName": "DatewExtract_fromFileName", "value": { "value": "@substring( variables('filename') ,indexof(variables('filename'),'2') ,8 )", "type": "Expression" } } } ] } }, { "name": "Print the filename with the latest timestampp", "type": "SetVariable", "dependsOn": [ { "activity": "Loop through all the file", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "variableName": "FinalOutput", "value": { "value": "@variables('GetLatestFileName')", "type": "Expression" } } } ], "variables": { "filename": { "type": "String" }, "TakeAnyStartDate": { "type": "String", "defaultValue": "20001027" }, "GetLatestFileName": { "type": "String" }, "FinalOutput": { "type": "String" }, "DatewExtract_fromFileName": { "type": "String" } }, "annotations": [] } }