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

How to send Dataverse email through PowerAutomate

How to avoid "for each" in Power Automate when there is only one record in Dataverse List rows