In this Power Automate Desktop tutorial, we will see how to fix an error “Argument ‘Body’ must be ‘Binary'” in Power Automate.
I recently created a desktop process that includes a custom form. Based on the response, the workflow generates data items in a SharePoint list upon form submission. Subsequently, I need to attach files to the specific items created.
Once I ran the flow in Power Automate Desktop, I encountered the error “Argument ‘Body’ must be ‘Binary’.
So, in this Power Automate tutorial, we will discuss the solution of how to solve the error when the argument ‘body’ must be a ‘Binary’ value.
“Argument ‘Body’ must be ‘Binary'” in Power Automate Desktop
Here we are using a SharePoint list i.e. Product Details, in which we will create an item and add an attachment.
This list contains the below columns and looks like the following:
- Title-Single line of text
- Name- Single line of text
- Description-Multiple lines of text
- Price- Currency
- Quantity- Number
To create items in the SharePoint list and add attachments, first, I created a custom form like the one below:
Based on the Form response, we will create an item, for this I have added the Create item action and then mapped the response data to the Sharepoint list field.
Lastly, we need to attach the created item to the SharePoint list, for this, i have provided the ID value, file name, and file content.
Now, when I run the flow, I come across this error – “Argument ‘Body’ must be ‘Binary'” and my flow failed.
Now let’s see how I fix this error and my flow runs successfully.
Solution- “Argument ‘Body’ must be ‘Binary’ error in Power Automate Desktop
Here first, let us understand why we face this error: ‘Argument ‘Body’ must be ‘Binary ’ in Power Automate Desktop.
Now, if you look closely at the action ‘Add attachment’, in the File content field I have provided the content as ‘%CustomFormData.Testimonial%’. Here, we are directly selecting the file from the custom form data. But the File content fields accept binary data.
To fix this error, I have made 2 changes to my flow,
1- Add an action that will convert the file to binary
Next, to Create an item action in desktop flow, drag and drop a Convert file to binary action. Then provide the information below
- File path: Provide the path like the below argument:
2- Provide the above Binary data output to the File content field
For this, open the ‘Add attachment’ action-> then change the File content field value by selecting the variable ‘BinaryData’.
This is how we can fix the error “Argument ‘Body’ must be ‘Binary'” in Power Automate Desktop
In this Power Automate Desktop tutorial, we saw how we can fix the Power Automate Desktop error- “Argument ‘Body’ must be ‘Binary’“
You may also like:
- How to Update Items in a SharePoint List in Power Automate Desktop?
- Create and Delete an Item from a SharePoint List using Power Automate Desktop
- Convert Data Table Columns to List in Power Automate Desktop
- The DateTime String must match ISO 8601 format error in Power Automate
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com