cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Rkaur
Level: Powered On

Dynamics 365 "update record (preview)" fails with Bad request error 'PrimitiveValue' node

Hi,

 

I need to update my entity record field attribute with a specific value based on microsoft flow execution results.

flow - there's an approval step and post that based on teh response of teh approver if it was "Approved" one of the custom fields in the entity "Approved By" should show the Approver name.

However, The "Update a record" dynamics conector step fails to update with error -

 

"An error occurred while validating input parameters: Microsoft.OData.ODataException: A 'PrimitiveValue' node with non null value was found when trying to read the value of the property 'new_ApprovedBy';  however, a 'StartArray' node,  a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.".

screensoht below.

update record step.PNG

6 REPLIES 6
Community Support Team
Community Support Team

Re: Dynamics 365 "update record (preview)" fails with Bad request error

Hi @Rkaur,

 

Could you share more details on the update record action?

I have made a flow to update Approval response to opportunity description field. It is configured likes below:

Please take it for a reference.

1.PNG2.PNG

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Rkaur
Level: Powered On

Re: Dynamics 365 "update record (preview)" fails with Bad request error

Hi Mabel,

 

Please see the screen attached.  There are two "Approved By" attributes as shown but in the entity fields there's only one that i created and it is a lookup field for Users in the system.

When i used the second field to set "Approver name" it gave "Primitive node"error but now when i removed it from there and mapped it only to first field ( as part of debugging) it gave 400 error "4.0\r\n\r\n{\"error\":{\"code\":\"0x0\",\"message\":\"')' or ',' expected at position 8 in '(Mathew Hayden)'.\",\"innererror\":{\"message\":\"')' or ',' expected at position 8 in '(Mathew Hayden)'.\",\"type\":\"Microsoft.OData.ODataException\",\"

 

In the second screenshot, are the error logs where value is captured correctly, the name of the approver and teh error code 400.

What could "',' expected at position 8 in '(Mathew Hayden)' " mean ?

update record 1.PNGupdate record 2.PNG

Rkaur
Level: Powered On

Re: Dynamics 365 "update record (preview)" fails with Bad request error

found The issue - Approver name contains a space in the value "FirstName LastName' and Microsoft flow is not able to recognize it.

Very strange but if there is a output variable to use"Approver name" in our flow execution then "UPdate a record (preview)"dynamics 365 connector doesnt recognizs the space and fails with error-

{\"message\":\"')' or ',' expected at position 8 in '(Mathew Hayden)'.\",\"type\":\"Microsoft.OData.ODataException\",\"

as it is considring mathew as the terminating string.

when i pass just "Firstname" in it, flow works.

 

Please provide a solution to passing full name inclusive of first and last name in the update step.

Rkaur
Level: Powered On

Re: Dynamics 365 "update record (preview)" fails with Bad request error

ANy update please ?

m blocked on this. please suggest a workaround solution on how to pass "Approver's name from flow to update entity record field attribute

Community Support Team
Community Support Team

Re: Dynamics 365 "update record (preview)" fails with Bad request error

Hi @Rkaur,

 

Thanks for updating.

It seems that a blank between first name and last name cannot be recognized by flow.

Please try to remove the space or replace the space with “%20”.

Here I made a simple replace test using the following code, please take it for a reference:

replace(outputs('Compose'),' ','%20')

 1.PNG

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Rkaur
Level: Powered On

Re: Dynamics 365 "update record (preview)" fails with Bad request error

Hi Mabel,

eplacing space woud work but finally this update connector has to update a field in record which is a lookup field to user entity. user name is "Mathew Hayden" and the flow will pass "MathewHayden"

CRM would see this as a fied value mismatch and would not map it. 

got the error again different though- 

 
Entity Name
Expense Reports
Record identifier
bf9def14-85e1-e811-a96b-000d3af2905b
item
{
  "_new_approvalstatus_label""Approved",
  "new_ApprovedBy""Mathew%20Hayden",
}
error - Type: application/json; odata.metadata=minimal\r\nOData-Version: 4.0\r\n\r\n{\"error\":{\"code\":\"0x0\",\"message\":\"An error occurred while validating input parameters: Microsoft.OData.ODataException: A 'PrimitiveValue' node with non-null value was found when trying to read the value of the property 'new_ApprovedBy'; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.\\r\\n   at Microsoft.OData.JsonLight.ODataJsonLightPropertyAndValueDeserializer.ValidateExpandedNestedResourceInfoPropertyValue(IJsonReader jsonReader, Nullable`1 isCollection, String propertyName)\\r\\n   ..............................

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 282 members 4,901 guests
Please welcome our newest community members: