Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Answered

Auto populate Lookup Column

(0) ShareShare
ReportReport
Posted on by 84

I have 2 Tabes, Sites and Surveys

 

In the Sites table i have 5 columns, SiteID, SiteName, PostCode, EmailAddress, PhoneNumber

 

On the Surveys table i want to be able to get the Site Name from the siteID based on what is in the Sites table

 

I have created a 1 to many relationship from the sites but do not know what to do next in order for the Site Name to auto populate

 

Can you help me with this

Categories:
  • Sid_Jafri Profile Picture
    Sid_Jafri 478 on at
    Re: Auto populate Lookup Column

    Hi @Lynch66 ,

    If SiteName is primary name column in your sites table then when you create 1 to many relationship in Survey, it will show the sitename in your survey lookup field for Site. However if it is not your primary name column and SiteId or any other is primary name column then there are two options.

     

    1. Create a new column in your Survey table for SiteName and make it calculated column, get the SiteName in your calculation and place that field into your form

    2. Create a quick view in Site table and use only SiteName in the Quickview, Goto Survey form and add a component from top menu ribbon then select the quick view under Related Data from left Navigation menu. Select the Lookup and Category (quick view) and it will be added to the form.

    Please Thumbs up and accept as solution if my post helped you solve your issue.

     

     

     

  • Drew Poggemann Profile Picture
    Drew Poggemann 9,273 on at
    Re: Auto populate Lookup Column

    Hi @Lynch66 ,

     

    You might not be happy with a Power Automate approach here since it would be asynchronous so when you click to add a new table for the child entity the information will not be populated until after the record is saved and then might take some time from there.  The user would need to refresh their screen to see the information populated...

     

    If you are utilizing a model-driven application the column mappings is the best way to default from a related entity when you create the child table from the parent.  It will populate the data on the form as you go into create a new record.  The 2nd approach @ChrisPiasecki mentioned I use a lot as well to default other fields / information based on what I entered on the form and it is real time.

     

    If you still want to go down the Power Automate approach you would do the following:

    1. Select your solution that you are working with to do the custom development and then select to do a "New Cloud Flow"
    2. Trigger:  Select Dataverse as Trigger source and trigger "when a row is added, modified, deleted" and select your table and scope.  I am using Contacts as my table (as example only)
      dpoggemann_0-1625509265897.png

       

    3. Select Dataverse and "Get a row by ID" where you will select the lookup column for your Site from the Surveys table (assuming you made this a required field on the Surveys table) 😀.  I am using Account in my example as it is a related entity to the Contact table...
      dpoggemann_1-1625509378485.png
    4. From here you will choose to Update the Surveys table and pull in the information you want from the Site table to default on this table if needed...  The id you will use will be from your when a row is added, modified, or deleted.  here you will be able to default any fields you need from the Site table on to the Surveys table.  Once again I am using the Contact table as example...
      dpoggemann_2-1625509552435.png

       

    Hope this helps.  Please accept if this answers your question or Like if helps in any way.


    Thanks,


    Drew

     



     

  • Lynch66 Profile Picture
    Lynch66 84 on at
    Re: Auto populate Lookup Column

    Hi @ChrisPiasecki 

     

    Would you be able to show me how this is done with Power Automate

  • Verified answer
    ChrisPiasecki Profile Picture
    ChrisPiasecki 6,389 on at
    Re: Auto populate Lookup Column

    Hi @Lynch66,

     

    If you're using a model driven app, you can define Column Mappings in your 1:N Relationship configuration. This will auto populate fields from a parent Lookup field when creating a new record. Note that you must use the +Add from a sub grid or associated view for the auto populating to work.

     

    You can also use a real time Dataverse workflow to populate the information from the parent record when saving the record. 

     

    Finally, you could use a Power Automate Cloud flow to do the same as a Dataverse workflow but asynchronously (near real-time). 

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard

Featured topics