Following scenario:
An entity has a required Contact field. During creation of new items this value should be used for a new connection role.
Flow (last step fails):
> Trigger on item creation > Initialize variable as string for Role-Id > Get all Connection Roles > Find the right role and store ID in variable initialized before > Create a new Connection record with ID variable set for "Role (from)" "Role (to)"
Issue:
Something seems to be missing and I receive following error if I try to create a new entity Connection:
There are no ConnectionRoleId and AssociatedObjectTypeCode pairs present.
I think I have set all relevant and available fields, but something is missing I guess.
Any help is really appreciated here.
Inputs:
{ "host": { "apiId": "subscriptions/[SUBSCRIPTION-ID]/providers/Microsoft.Web/locations/westeurope/runtimes/europe-001/apis/commondataservice", "connectionReferenceName": "shared_commondataservice", "operationId": "PostItem_V2" }, "parameters": { "dataset": "default.cds", "table": "connections", "item/statuscode": 1, "item/_ownerid_type": "", "item/_record2roleid_value": "[ROLE-ID]", "item/_record1roleid_value": "[ROLE-ID]", "item/_record2id_value": "[CONTACT-ID]", "item/_record2id_type": "contacts", "item/_record1id_value": "[ENTITY-ID]", "item/_record1id_type": "[CUSTOM-ENTITY-TYPE]" } }
Outputs:
{ "statusCode": 400, "headers": { "Pragma": "no-cache", "x-ms-request-id": "***", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "DENY", "Timing-Allow-Origin": "*", "x-ms-apihub-cached-response": "false", "Cache-Control": "no-store, no-cache", "Date": "Tue, 01 Oct 2019 13:29:38 GMT", "Set-Cookie": "ARRAffinity=****;Path=/;HttpOnly;Domain=commondataservice-we.azconn-we.p.azurewebsites.net", "Content-Length": "504", "Content-Type": "application/json", "Expires": "-1" }, "body": { "status": 400, "message": "There are no ConnectionRoleId and AssociatedObjectTypeCode pairs present. Entities being connected: ([CUSTOM-ENTITY-TYPE],contact); Entity Records being connected: (null,null); Record1ConnectionRoleName: null, Record2ConnectionRoleName: null. ConnectionRoleIds: [ROLE-ID], [ROLE-ID];", "source": "***.crm4.dynamics.com", "errors": [], "debugInfo": "clientRequestId: ***" } }
Yes @v-bacao-msft, the values themselves are fine, but it seems something is missing as a settable value for the "Create record" action.
What makes me thinking that is the following:
The error shows that some values seem to be missing and the relating entities (custom entity and Contact) seem not to be set:
Entity Records being connected: (null,null); Record1ConnectionRoleName: null, Record2ConnectionRoleName: null
Whereas all available values inside advanced options are set with following:
Role(To): [ConnectionRole1Id as String] Role(From): [ConnectionRole1Id as String] ConnectedWith: [ContactId as String] ConnectedWithType: contacts ConnectedBy: [CustomEntityId as String] ConnectedByType: custom_entity
These are all fields that can be set and I'm pretty sure about the correct values and their formats.
Hi @tohms ,
Have you checked that every action in the Flow run history is executed as expected and gets a valid value?
Best Regards,
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1