Argument ‘Body’ must be ‘Binary’ – Power Automate Desktop error

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’.

Power automate desktop 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
  • Attachments-Attachments
Microsoft Power automate desktop error 'Argument 'body' must be 'Binary'

To create items in the SharePoint list and add attachments, first, I created a custom form like the one below:

MS Power automate desktop error 'Argument 'body' must be 'Binary'

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.

Error 'Argument 'body' must be 'Binary' in Microsoft Power automate desktop

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.

Error 'Argument 'body' must be 'Binary' in MS Power automate desktop

Now, when I run the flow, I come across this error – “Argument ‘Body’ must be ‘Binary'” and my flow failed.

Power automate desktop error 'Argument 'body' must be 'Binary'

Now let’s see how I fix this error and my flow runs successfully.

See also  List variables in Power Automate Desktop

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:
%CustomFormData.Testimonial%
Error 'Argument 'body' must be 'Binary' in Power automate desktop

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’.

How yo fix error 'Argument 'body' must be 'Binary' in Power automate desktop

This is how we can fix the error “Argument ‘Body’ must be ‘Binary'” in Power Automate Desktop

Conclusion

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:

>