I am trying to attach files to send to an email address so I created a File Holder Array. This is what I append to it:
"name' is from One Drive file metadata;
"contentBytes" is from One Drive file content;
"Email" is taken by splitting file name no extension on '_' (file name is like this "ABCD ABCD_someone@gmail.com.xlsx" )
Before adding the email, this file holder was enough to attach all files without errors using Send an email (V2).
After adding the email, contentbytes is always assigned to null, despite the file content not being changed.
Hope you can help me to solve this problem 🙂
Thank you so much in advance!
Could you show me the whole split() formula? The problem might be that split() is returning an array - you have to select the specific array item to get a single string.
I work with Iulia on this Flow and will answer when she's not around. There shouldn't be any issue with the split() function, we get the email wherever we use it. As specified, only the "ContentBytes" section turns out null, everything else works as intended. For reference, that split() looks like this:
Okay, unfortunately that was my only idea on that so far. 🙂 Could you try to insert a Compose action (and choose the array to be composed) to check if there is a problem with creating the array or with the Send email action?
The array "succeeds" when its populated at the start; it shows with a green checkmark, Name and Email populate as expected, but ContentBytes is null.
First iteration we did not have an Email property in the array; only Name and ContentBytes. At this point, ContentBytes was being populated correctly and emails were being sent with attached files. But some logic further down required us to save the Email too in the array, hence we added the field. At this point, ContentBytes broke for every element in the array.
Thank you for your replies; hopefully this comment shed some light on our situation.
I honestly have no idea at this point why this is happening, but maybe a workaround: What about creating another array, containing Name and Email, and get rid of Email in your File Holder variable? Then you can identify the records belonging together by the Name property as long as it's unique. Maybe not the most elegant way, but it might be working...
We just fixed it!
The "File content" dynamic element was originally copied from a different array that we worked with. It was at this point that it started returning null. I assume the reference broke. Our flow worked as expected once we deleted the old "File content" and replaced it with a new one selected from the Dynamic Elements menu.
We probably should have tried this sooner, but we didn't expect it to break when copying elements around.
Thanks for taking an interest in this issue. Hopefully this thread will be of help to someone in a similar spot.
Check out the new Process Advisor community forum board!
Check out new user group experience and if you are a leader please create your group
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.