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

How to set a lookup field to an other entity?

Hi everybody, 
I made a new dataintegration project in web.powerapps, to import Data from SQL into Dynamics 365.
How can I set a Lookup e.g.  Contact in an order? 

6 REPLIES 6
Maurits
Level 8

Re: How to set a lookup field to an other entity?

Normally a lookup to another entity is defined by creating a "many to one" relationship.

This creates the field in the entity which can point to a record in another entity.

Is that what you meant?

 

Good luck!

kimkantola
Level: Powered On

Re: How to set a lookup field to an other entity?

Hi I have what I think is the same question.

 

Say I have a PowerApp, I have an Entity of Ice Cream Orders, then I have a Entity of Ice cream Flavors.

I want the Form for the Ice Cream Order Entity to have a drop down list of possible Ice Cream Flavors.  It will be a One:One relationship, the Order can only pick One flavor.  Is that a One:One relationship since they can only pick one flavor, or is that a One:Many relationship since they can pick from Many choices?

 

Thanks!

 

Maurits
Level 8

Re: How to set a lookup field to an other entity?

@kimkantola That would be a One:Many relationship from Flavour to Order.There can be just one flavour per order, but there can be many orders with that flavour. You could call it Many:One or One:Many, doesn't matter, but the order entity will contain a field which is related to the flavour entity.

 

 

MartinK1704
Level: Powered On

Re: How to set a lookup field to an other entity?

Hi everybody,
thanks all for the answers.
In the Datamodel it ist configured as many to one Relation - One Contact can have multiple Orders.
In the order entity is a Field CustomerId which type is an entityreference.
When i maike manually an Order in the Dynamics 365 app, I create a new Order and in the form I choose with the Lookup Control a customer.
But now I have a Thirdparty System with a SQL Database.

Task 1. I import Customers  e.g Name: Sam ID: 1

Task 2. I import the Order e.g.  OrderId: 20, CustomerNumber: 1

The Mapping for Order is
OrderID -> OrderNumber
Lookup("Contact" , CustomerId) -> CustomerId
The function Lookup must return the Guid (Entityreference) from Customer Sam was created in Task 1
My Problem in Dataintegration in no transformation Funktion for Lookup.

 

Best regards
Martin

Community Support Team
Community Support Team

Re: How to set a lookup field to an other entity?

Hi @MartinK1704 ,

Do you want to create a lookup field in CDS?

There has been a data type named look-up for your choice.

You could add relationship in the option of relationship.

There are three relationship: many-to-many,one-to-many, many-to-one.

One is related entity, many is primary entity. And the lookup field will display in the primary entity automaticly after you creating relationship successfully.

What's more, the lookuo filed will display as a drop down in the form of PowerApps. You could choose the data of the related entity.

Here's  doc for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/create-edit-entity-relationship...

https://powerapps.microsoft.com/en-us/blog/relate-records-in-many-to-many-relationships/

 

 

Best regards,

Community Support Team _ Phoebe Liu

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.
MartinK1704
Level: Powered On

Re: How to set a lookup field to an other entity?

Thanks,

but setup the Relation in CDS is not my Problem.
Fill the Lookup field in the dataintegration Projekt is the Problem.
In my Importdata I don't have the ContactId. I only have a Customer Number. This Customernumber is a Key in Contact entity. I will create a new Order and map the Contact. Search the Contact with the Customers number in the keyfield in the contact entity. Then fill up the ContactId into the Lookupfield.

Best regards
Martin

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,632)