Posts

Showing posts from July, 2021

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

Image
There was a requirement where a note(annotation) will be created once an account is created in Dataverse. I have created a Microsoft flow to achieve this functionality. Below is the screenshot of the flow: It was not a difficult flow but I was getting below error in last step i.e, "Create a note and attach PDF" Resource not found for the segment. The reason for this error was assigning "Account id" in regarding: To resolve the above error, I have set "accounts(Account)" in regarding and it worked. You can also use "/accounts(Account)". Conclusion : Whenever you are creating a #Dataverse note or activity through #MSflow then use "entityname(entityid)" or "/entityname(entityid)" in regarding and don't forget to add suffix "S" in entityname. Cheers, Rocker

How and when to use Base64 expression in Microsoft flow.

Image
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 follo

Workflow Error: Could not load type 'System.Buffers.Text.Utf8Formatter' from assembly

We were using Pre-Image in our workflow and returning an attribute value of this pre-image as an output parameter. Suddenly we were getting the below error: An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): MyProject.Workflow.Value: System.Exception: Could not load type 'System.Buffers.Text.Utf8Formatter' from assembly 'MyProject.Workflow' because the method 'TryFormatDecimalG' has no implementation (no RVA).  The code was like this: Entity preImageEntity = crmWorkflowContext.WorkflowExecutionContext.PreEntityImages.Contains("PreBusinessEntity") ? crmWorkflowContext.WorkflowExecutionContext.PreEntityImages["PreBusinessEntity"] : null; StringAttrValue.Set(context,  preImageEntity .Attributes[AttributeName.Get(context)]); To resolve this issue, We have to implicitly cast attribute name "To String" as shown below StringAttrValue.Set (context,  preImageEntity  .Attributes[