web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : tLokJid3izb+ARXzQxABU2
Power Automate - Building Flows
Unanswered

Assigning connection (role) throws error

Like (0) ShareShare
ReportReport
Posted on 1 Oct 2019 13:56:16 by 5

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: ***"
 }
}
I have the same question (0)
  • tohms Profile Picture
    5 on 02 Oct 2019 at 08:29:17
    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.

     

  • v-bacao-msft Profile Picture
    on 02 Oct 2019 at 02:47:38
    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,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete