cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Automatically Creating Connections Between Entities

Hello all,

 

I have a process flow in a model driven PowerApp in which I am trying to connect three records together.

 

I know how to connect them manually, but I want to do this with MS flow.

 

Here is what I have, shown in the picture below - 

When an item (EWR) is created, I want a Product ID record to be created.

I want that Product ID record to update witth the product id listed in the previous step (EWR).

Then, the third step (POB) is created, with a link back to the first step (EWR). 

I essentially want MS Flow to create and update the required cards with the information. 

Process.Flow.PNG

 

In the first EWR step, the "Product ID 1 - Record" is the lookup field to new record which is created and populated by "Product ID 1".

PRodIDRecord.PNG

 

I get an error message in my Flow when I try to update first steps "Product ID 1 -Record" field with the newly created Product ID record in order to link them together.

 

Error:

{
"status": 400,
"message": "--batchresponse_13381004-eee7-439f-be1f-798ee02a4ebc\r\nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 400 Bad Request\r\nREQ_ID: d7f120e7-b9dc-4d15-8131-be410048e22b\r\nContent-Type: application/json; odata.metadata=minimal\r\nOData-Version: 4.0\r\n\r\n{\"error\":{\"code\":\"0x0\",\"message\":\"Bad Request - Error in query syntax.\",\"innererror\":{\"message\":\"Bad Request - Error in query syntax.\",\"type\":\"Microsoft.OData.ODataException\",\"stacktrace\":\" at Microsoft.OData.UriParser.ODataUriResolver.ResolveKeys(IEdmEntityType type, IList`1 positionalValues, Func`3 convertFunc)\\r\\n at Microsoft.OData.UriParser.SegmentArgumentParser.TryConvertValues(IEdmEntityType targetEntityType, IEnumerable`1& keyPairs, ODataUriResolver resolver)\\r\\n at Microsoft.OData.UriParser.SegmentKeyHandler.CreateKeySegment(ODataPathSegment segment, KeySegment previousKeySegment, SegmentArgumentParser key, ODataUriResolver resolver)\\r\\n at Microsoft.OData.UriParser.SegmentKeyHandler.TryCreateKeySegmentFromParentheses(ODataPathSegment previous, KeySegment previousKeySegment, String parenthesisExpression, ODataUriResolver resolver, ODataPathSegment& keySegment, Boolean enableUriTemplateParsing)\\r\\n at Microsoft.OData.UriParser.ODataPathParser.TryBindKeyFromParentheses(String parenthesesSection)\\r\\n at Microsoft.OData.UriParser.ODataPathParser.TryCreateSegmentForNavigationSource(String identifier, String parenthesisExpression)\\r\\n at Microsoft.OData.UriParser.ODataPathParser.CreateFirstSegment(String segmentText)\\r\\n at Microsoft.OData.UriParser.ODataPathParser.ParsePath(ICollection`1 segments)\\r\\n at Microsoft.OData.UriParser.ODataPathFactory.BindPath(ICollection`1 segments, ODataUriParserConfiguration configuration)\\r\\n at Microsoft.OData.UriParser.ODataUriParser.Initialize()\\r\\n at Microsoft.Crm.Extensibility.OData.CrmEdmEntityReference.CreateCrmEdmEntityReference(Uri link, IEdmModel edmModel, CrmODataExecutionContext context, EntitySetSegment& entitySetSegment)\\r\\n at Microsoft.Crm.Extensibility.OData.TypeConverters.EdmEntityTypeConverter.SetNavigationPropertyToXrmEntity(Entity entity, IEdmProperty edmProperty, EntityRelationship entityRelationship, Object propertyValue, Nullable`1 role)\\r\\n at Microsoft.Crm.Extensibility.OData.TypeConverters.EdmEntityTypeConverter.ConvertToCrmTypeInternal(EdmEntityObject edmTypeValue)\\r\\n at Microsoft.Crm.Extensibility.OData.TypeConverters.EdmTypeConverterBase`2.ConvertToCrmType(Object edmTypeValue)\\r\\n at Microsoft.Crm.Extensibility.OData.EdmTypeConverter.ConvertToCrmEntity(EdmEntityObject edmEntity, EntityReference entityReference, IEdmModel edmModel)\\r\\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\\r\\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\\r\\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.UpdateEdmEntity(CrmODataExecutionContext context, String edmEntityName, String entityKeyValue, EdmEntityObject entityObject)\\r\\n at Microsoft.Crm.Extensibility.OData.EntityController.PatchEntityImplementation(String& entityName, String key, EdmEntityObject entityDelta)\\r\\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\\r\\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\\r\\n at lambda_method(Closure , Object , Object[] )\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\\r\\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"}}}\r\n--batchresponse_13381004-eee7-439f-be1f-798ee02a4ebc--",
"source": "orgde17e60e.crm.dynamics.com",
"errors": [],
"debugInfo": "clientRequestId: e46fe962-5a44-44cb-a3f3-9e66e0a74acc"
}
1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Based on your error message: 'Bad Request - Error in query syntax', your problem should because:

The OData Service URL that contains the Lookup Query is incorrect.

Please check the following information in the OData service call:

  • Service URL parameter names and values.
  • Service URL value type (add explicit cast, if necessary).

Please check this documentation about Microsoft Flow troubleshooting for a reference. You may try to update your flow configuration to fix the issue:

https://docs.microsoft.com/en-us/flow/fix-flow-failures

 

What's more,I think your issue is about flow, I suggest you post your issue here:

https://powerusers.microsoft.com/t5/Forums/ct-p/FL_Comm_Forums

There will be engineers who are more professional about flow to help you.

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (48,030)