Created
November 4, 2019 06:00
-
-
Save justinyoo/a04b468a7a0790ff6e0b531a69161aff to your computer and use it in GitHub Desktop.
Getting the Latest Array Item in Logic App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"List_Backups": { | |
"type": "ApiConnection", | |
"runAfter": {}, | |
"inputs": { | |
"method": "get", | |
"host": { | |
"connection": { | |
"name": "@parameters('$connections')['azureblob']['connectionId']" | |
} | |
}, | |
"path": "/datasets/default/foldersV2/@{encodeURIComponent(encodeURIComponent('/backup'))}", | |
"queries": { | |
"nextPageMarker": "", | |
"useFlatListing": false | |
} | |
} | |
}, | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"Take_Latest_Backup": { | |
"type": "Query", | |
"runAfter": { | |
"Select_Filenames_from_Backups": [ | |
"Succeeded" | |
] | |
}, | |
"inputs": { | |
"from": "@body('List_Backups')?['value']", | |
"where": "@equals(int(first(split(item()?['Name'], '.'))), max(body('Select_Filenames_from_Backups')))" | |
} | |
}, | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"Select_Filenames_from_Backups": { | |
"type": "Select", | |
"runAfter": { | |
"List_Backups": [ | |
"Succeeded" | |
] | |
}, | |
"inputs": { | |
"from": "@body('List_Backups')?['value']", | |
"select": "@int(first(split(item()?['Name'], '.')))" | |
} | |
}, | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment