Hi all,
I'm trying to accomplish two tasks:
- Find and upload the missing files from our website based on a list of files in our database.
- The list of database images has more details because I'll have to use an apply to each on the filtered results to locate the original records to download the image that will then be SFTP'd to the website.
- Delete files from our website that aren't listed in our database.
For task 1 I was trying to compare 2 select action outputs using a Filter Array action but the Filter Array action isn't working correctly. I've done something wrong because I get all the items listed from the 1st Select Actions output. Can anyone help me figure out what I'm doing wrong?
1st Select - List of Website Images
From - @{body('List_files_in_folder_-_SFTP_-_SSH_-_List_Images')}
Map - {
"Image File Name": "example.jpg"
}
2nd Select - List of Database Images
From - @{outputs('List_rows_-_Listings_-_Images')?['body/value']}
Map - {
"Listing ID": "1",
"Product Name": "Test",
"Image File Name": "example.jpg",
"Image File URL": "https://website.com/example.jpg",
"Table": "product_tbl",
"Row ID": "12345"
}
Filter Array - Images to be uploaded to website
From - body('Select_-_List_of_Database_Images')
Edit in advanced mode - @not(contains(body('Select_-_List_of_Website_Images'), item()?['Image File Name']))
The "Filter Array - Images to be uploaded to website" action's output always returns everything from the "Select - List of Database Images" output. I only want the output showing the entries from the database that aren't on the website.
Thoughts?