Why does a foreach loop refuse inline code results but accepts list files on sftp in logic apps

Brian O'Dwyer 1 Reputation point
2022-04-04T14:09:01.49+00:00

Hi,

I have searched and searched t'internet but have not yet seen a categoric and official "it just works that way".

I have a list of files from an SFTP list files in folder connector. It is a pure json array within the body of the output.
I read this into inline code and add just pass it out. In my app, I obviously do something with it ;)
The output is also a pure json array within the body of the output but of course, it is not called body but "Results".
My foreach loop will accept Results from inline and Body from list files on server but when I add a step, whatever it is, it sees the object keys from the body from the list but only sees Results from the inline code.
Is this "just how it is"?

Here is the list files output (body raw content)

[
{
"Id": "L1BpY2t1cC9HQ0g2Mzc0OA==",
"Name": "GCH63748",
"DisplayName": "GCH63748",
"Path": "/Pickup/GCH63748",
"LastModified": "2022-03-28T07:41:05Z",
"Size": 6805,
"MediaType": "application/octet-stream",
"IsFolder": false,
"ETag": "\"MDMvMjgvMjAyMiAwNzo0MTowNXw2ODA1\"",
"FileLocator": "L1BpY2t1cC9HQ0g2Mzc0OA==",
"LastModifiedBy": null
}
]
Here is the inline code output (Results raw content)

[
{
"Id": "L1BpY2t1cC9HQ0g2Mzc0OA==",
"Name": "GCH63748",
"DisplayName": "GCH63748",
"Path": "/Pickup/GCH63748",
"LastModified": "2022-03-28T07:41:05Z",
"Size": 6805,
"MediaType": "application/octet-stream",
"IsFolder": false,
"ETag": "\"MDMvMjgvMjAyMiAwNzo0MTowNXw2ODA1\"",
"FileLocator": "L1BpY2t1cC9HQ0g2Mzc0OA==",
"LastModifiedBy": null
}
]

Thank you for any information you can provide to assist me with a workaround or point out my mistake.

Brian.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.