Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created November 4, 2019 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/a04b468a7a0790ff6e0b531a69161aff to your computer and use it in GitHub Desktop.
Save justinyoo/a04b468a7a0790ff6e0b531a69161aff to your computer and use it in GitHub Desktop.
Getting the Latest Array Item in Logic App
{
...
"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
}
}
},
...
}
{
...
"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')))"
}
},
...
}
{
...
"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