What is causing this error - Value cannot be null.\r\nParameter name: s\r\n at System.Convert.FromBase64String(String s)"

Gareth T 30 Reputation points
2025-03-25T17:37:20.17+00:00

I have two flows in a standard logic app which get attachment content from a lists item and for each attachment append the results to an array variable.

{

"Name": "@{item()?['DisplayName']}",

"content-type": "@{body('Get_attachment_content_1')['$content-type']}",

"contentBytes": "@{body('Get_attachment_content_1')['$content']}"

}

I then attach the variable to the email attachments. This works perfectly fine in the one flow which was developed a few months ago but now when I have copied this to the new flow I get this message:

{ "error": { "code": 500, "message": "Value cannot be null.\r\nParameter name: s\r\n at System.Convert.FromBase64String(String s)", "source": "dc11a033abdcc4d3.03.common.logic-canadacentral.azure-apihub.net", "path": "choose[6]\when[1]", "policyId": "", "clientRequestId": "78567566-a709-4255-bb6e-f7f28a772055" } }

I have checked that inputs of the email and everything looks like it should, I have also run the email in the for each and attached the images individually to eliminate a corrupt content but this worked perfectly.

What could be causing this?

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

1 answer

Sort by: Most helpful
  1. Shireesha Eeraboina 3,435 Reputation points Microsoft External Staff Moderator
    2025-03-27T05:31:47.7966667+00:00

    Hi Gareth T,

    Thank you for your patience and for sharing your feedback on the Q&A community platform. I’m glad to hear that you were able to resolve your issue, and I appreciate you sharing your solution! Your contribution is valuable and can help others in the community facing similar challenges.

    As per the Microsoft Q&A community policy, "The question author cannot accept their own answer. They can only accept answers by others"

    I’m reposting your solution here so you can mark it as accepted if it resolves your query:

    "The issue happened because the Outlook connector changed the field name from contentBytes to ContentBytes. The customer’s workflow was using the old name, which caused it to stop working. After updating the variable to use ContentBytes, everything started working again".

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.  

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

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