cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Lookups In CDS

Hi,

I have an entity called participants and an enitity called visit location.

Each Visit Location record includes a date that the visit location record is assigned. Example: Orlando, FL 7/14/2020

In the participant entity participants are assigned a visit location via the Visit Location look up. 

When that lookup selection is made I want the date of visit location to be prepopulated in the visit date on the participants record.

 

I can't figure out how to do this as a business rule or as a flow.  Any ideas would be most appreciated.

Thank you,

Melody

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Is the "Visit Location" field a LookUp field in your Participants Entity?

Do you want to pre-populate the "Visit Date" field value with corresponding date value of the selected Visit Location in your Edit form?

Further, do you want to achieve your needs in a Edit form which is connected to Participants Entity?

 

I assume that you generated an app based on your Participants Entity, and want to achieve your needs in a Edit form, right? Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

1.JPG

 

2.JPG

Set the DefaultDate property of the DueDate DatePicker control to following:

If(
    EditForm1.Mode = FormMode.New,
    LookUp(Contacts, Contact = DataCardValue9.Selected.Contact).'Created On',
    Parent.Default
)

 

On your side, you may need to try the following formula:

Set the DefaultDate property of the "Visit Date" field DatePicker control in your Edit form to following:

If(
    EditForm1.Mode = FormMode.New,
    LookUp('Visit Location Entity', 'Unique Identifier Column' = VisitLocationComboBox.Selected.Contact).DateColumn,
    Parent.Default
)

Note: The 'Unique Identifier Column' represents the Unique Identifier column in your Visit Location Entity, please replace it with actual column name from your Visit Location Entity. The VisitLocationComboBox represents the ComboBox inside your LookUp field data card to list available values from your Visit Location Entity. The DateColumn represents the date type column in your Visit Location Entity to store the date value for each Visit Location.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3

The easiest way to do this is a real time workflow. When the record lookup field is updated, update the date fields on parent with the values from the lookup record. 

power automate can also be used, the question is does it need to happen immediately or is a few second delay acceptable? If background update is ok, use power automate

So basically it is like the below data model. When a visit location is added to the lookup field on participant, the date from the selected visit location should go in the date field on the participant?

 

If so, create your flow on create or update of participant using the CDS current environment connector in a solution. filter it to only run on change of the visitlocation field using the filter field setting

 

You will then need a get record to get the full details of the related visit location

You should then be able to update the participant date field with the date from the get record step

visio.png

v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Is the "Visit Location" field a LookUp field in your Participants Entity?

Do you want to pre-populate the "Visit Date" field value with corresponding date value of the selected Visit Location in your Edit form?

Further, do you want to achieve your needs in a Edit form which is connected to Participants Entity?

 

I assume that you generated an app based on your Participants Entity, and want to achieve your needs in a Edit form, right? Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

1.JPG

 

2.JPG

Set the DefaultDate property of the DueDate DatePicker control to following:

If(
    EditForm1.Mode = FormMode.New,
    LookUp(Contacts, Contact = DataCardValue9.Selected.Contact).'Created On',
    Parent.Default
)

 

On your side, you may need to try the following formula:

Set the DefaultDate property of the "Visit Date" field DatePicker control in your Edit form to following:

If(
    EditForm1.Mode = FormMode.New,
    LookUp('Visit Location Entity', 'Unique Identifier Column' = VisitLocationComboBox.Selected.Contact).DateColumn,
    Parent.Default
)

Note: The 'Unique Identifier Column' represents the Unique Identifier column in your Visit Location Entity, please replace it with actual column name from your Visit Location Entity. The VisitLocationComboBox represents the ComboBox inside your LookUp field data card to list available values from your Visit Location Entity. The DateColumn represents the date type column in your Visit Location Entity to store the date value for each Visit Location.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,716)