How and when to use Base64 expression in Microsoft flow.

I have created a flow that gets trigger on update of an "account" entity record and creates a Note(Annotation) record in Dataverse, This note has a PDF attachment.

Flow is like this, in the last step, I am creating a note in Dataverse and attaching a newly created PDF in it:



But, I am getting the below error while attaching pdf in a note:

Invalid character in field 'documentbody': '', hexadecimal value 0x04, is an invalid character.

The reason behind it is the "Document" column, Flow accepts a file content in "Base64", hence I have to change it to base64:



Below are steps to convert it in "Base64":

Step 1: Click on the Document text box as highlighted below then click on "Expression".

Step 2: Search for "Base64" and put bracket().



Step 3: Click on "Dynamic Content", keep the cursor in between the bracket() and click on "File Content"




Step 4: Click ok.


Now, the Document Text box has the following value:



Step 5: Save the flow and test it. 


Issue resolved. 😀



Cheers,
Rocker














Comments

Popular posts from this blog

Power Automate: Create and attach Dataverse note or activity with an entity record through MS flow

{Error:Fetch XML}: The date/time format is not valid, or the value is outside the supported range

How to set privilege for Activity Attachment (activitymimeattachment) in Dynamics 365 or PowerApps