cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Connection between two entities

Hello!

I have two entities (Bookings and Customer - N:1 Relationship) and what I am doing is that I am creating a flow, so "when a record is updated"  within the Booking entity I want to "send an email notification". But the problem is that the e-mail address is within the Customer entity. So when I am about to create the flow and am in the step of filling out the "send an e-mail notification" where the first fill in is "To" I can only choose the fields from the Booking entity. 

 

Do you have any idea of how to fix it?

I am thinking if either of these ways work:

  • I could create an extra step within the flow (between "when a record is updated" and "send an email notification" to fix it somehow
  • It is possible to get the e-mail address from the customer entity to the booking entity so that every time a new e-mail address is added to the customer entity it will automatically generate in the booking entity also

Best regards,
Ina

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Connection between two entities

Hi @ina 

 

I recommend that you go for option 1 of your suggestions rather than 2.  As @LooseChippings says you will have to maintain the email address on the Booking when it changes on the Customer which is not ideal.

 

For option 1, you do not need to use a List Records step as @LooseChippings suggests.  Since your Booking and Customer records are related as N:1 then on your Booking record you will have a lookup field to Customer.  Use the CDS Get Record action to get the Customer record and use the Customer lookup field from the Booking as the input.

 

 

Hope that helps

 

 

-----
 
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

5 REPLIES 5
Highlighted
Frequent Visitor

Re: Connection between two entities

Hi

 

I am not a CDS pro but I have had the same situation.  Both your ideas will work.  You can insert the CDS List Records action in your Flow and bring back the entries in your Customer entity (my Customer list is quite large so I filtered it using the o-data filter CustomerInBookings eq 'CustomerInCustomers'' so only one record was returned).  Then the email address will be available in the dynamic content.

 

You could also have a separate Flow: When a new record is created in Customers -> create a new record in Bookings.  This would place the email address in the Bookings entity and it would be available in your Flow.  The only problem here is that if an email address in Customers is changed, it will have to be updated in Bookings, since (as far as I'm aware) there is no 'When a record is created or modified' trigger for CDS. 

 

I hope that helps.

Highlighted

Re: Connection between two entities

Hi @ina 

 

I recommend that you go for option 1 of your suggestions rather than 2.  As @LooseChippings says you will have to maintain the email address on the Booking when it changes on the Customer which is not ideal.

 

For option 1, you do not need to use a List Records step as @LooseChippings suggests.  Since your Booking and Customer records are related as N:1 then on your Booking record you will have a lookup field to Customer.  Use the CDS Get Record action to get the Customer record and use the Customer lookup field from the Booking as the input.

 

 

Hope that helps

 

 

-----
 
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

Highlighted
Helper I
Helper I

Re: Connection between two entities

Hi @HSheild,

I am using the CDS "Get Record" action and then using the LookupField as an input as you recommended but in the action "Send an email (V2)" I choose the "EmailField" and an error shows up saying:

"One or more recipients are invalid."
And as you can see on the picture below, it is like there is nothing in the "To" window...
EmailError.PNG
If I write my personal e-mail address in addition to the "EmailField" I do get the e-mail.
And just to mention, in the CDS the data type of the "EmailField" is "Email". 
 
Best regards,
Ina
Highlighted

Re: Connection between two entities

Hi @ina ,

 

From you screenshot, it looks like the input field that you are using does not contain an email address.  The field is empty.  Are you sure that the email field is populated in CDS?

Highlighted
Helper I
Helper I

Re: Connection between two entities

Hi @HSheild ,

Yes, it contains some input! So, the field that I am using is connected to an Excel sheet... so within the Excel sheet I add the e-Mail address that’s supposed to get the mail.

The flow is like this:

PowerAutomate.PNG

But when I test it the result is this here:

EmailError.PNG

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,074)