Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Assigning connection (role) throws error

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)"



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.



  "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]"


  "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;",
    "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": "***",
    "errors": [],
    "debugInfo": "clientRequestId: ***"
Community Support Team
Community Support Team

Re: Assigning connection (role) throws error


Hi @tohms ,


Have you checked that every action in the Flow run history is executed as expected and gets a valid value?


Best Regards,

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

Re: Assigning connection (role) throws error

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.


Helpful resources


Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!


Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

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


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,404)