How does Copilot identify relationships\foreign keys across relational data?

Patrick Nolan 0 Reputation points
2024-08-18T05:00:16.7066667+00:00

I'm creating a connector with a custom API Graph. As the API Graph only supports a flat structure of data, how does Copilot identify relationships\foreign keys across relational data? For example, how do I expose customer details with associated addresses. This is a one-to-many relationship. I assume I would need a Customer Connector\API and a CustomerAddresses Connector\API. Would copilot automatically work out the relational data by seeing the customerId in the customer address record?

Microsoft Copilot for Microsoft 365 Development
Microsoft Copilot for Microsoft 365 Development
Microsoft Copilot for Microsoft 365: Microsoft 365 Copilot refers collectively to Copilot experiences within Microsoft 365 applications.Development: The process of researching, productizing, and refining new or existing technologies.
154 questions
Microsoft Copilot
Microsoft Copilot
Microsoft terminology for a universal copilot interface.
355 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Afifa Shaikh - MFST 0 Reputation points Microsoft Vendor
    2024-09-18T08:30:29.8166667+00:00

    When working with a custom API Graph that supports only a flat structure of data, identifying relationships and foreign keys across relational data can be a bit challenging. However, Copilot can help you manage these relationships effectively.

    In your case, where you have a one-to-many relationship between customers and their addresses, you would indeed need to create separate connectors or APIs for each entity. For example, you would have a Customer Connector/API and a CustomerAddresses Connector/API.

    Copilot can automatically work out the relational data by recognizing the foreign key, such as customerId, in the customer address records. This means that when you query the CustomerAddresses API, Copilot can identify the customerId field and use it to link the addresses to the corresponding customer records.

    To summarize:

    1. Create separate connectors/APIs for each entity (e.g., Customer and CustomerAddresses).
    2. Ensure that the foreign key (e.g., customerId) is present in the related entity (e.g., CustomerAddresses).
    3. Copilot will use the foreign key to establish the relationship between the entities and provide the combined data as needed.
    0 comments No comments

  2. Afifa Shaikh - MFST 0 Reputation points Microsoft Vendor
    2024-09-18T09:21:05.7833333+00:00

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.