cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Resolver II
Resolver II

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!

Highlighted
Frequent Visitor

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!

 

Highlighted
Resolver II
Resolver II

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.

 

 

Highlighted
Frequent Visitor

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

Highlighted
Community Support
Community Support

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.
Highlighted
Frequent Visitor

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (1,949)