web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Subgrid - How to impor...
Power Apps
Suggested Answer

Subgrid - How to import data to a sub-grid in Model Driven App

(0) ShareShare
ReportReport
Posted on by 173
How to import multiple rows of data to a sub-grid in Model Driven App and still keep the relationship after import?
 
Allow me to expand, i have two tables that i would like to move to dataverse, Invoices (header) and Invoice_lines (child). They are linked via invoice_id field. I want to create a model driven app where a sub-grid (Editable), wherein I can edit the ones that already exist, and/or add new lines and add them to the Invoice_lines table while it maintains a relationship. 
 
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    the question is not clear as you don’t import data into a grid. You import data into a table and if an Entity has relationships and if you add a grid, it will show them. 
     
    Can you please explain the data you are importing and the relationship it has with existing data. 
     
    or are you importing data for the parent and the child?
  • Suggested answer
    Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at
    You may need to be more clear - a subgrid is just a control that shows records linked to the current record by either a one-to-many or a many-to-many relationship (but you can configure it to show all data in a table also).
     
    How you may import data is different for a one-to-many vs a many-to-many. For a one-to-many your import file must include a column that either has the GUID of the parent record or some other unique identifier on the parent record. You then use standard data import to import the records, you may need to update the Mappings depending on where your data is coming from. 
     
    many-to-many is more complicated, so will hold off describing it unless it is confirmed that is what you need
  • ctrl_kudorje Profile Picture
    173 on at
    Allow me to expand, i have two tables that i would like to move to dataverse, Invoices (header) and Invoice_lines (child). They are linked via invoice_id field. I want to create a model driven app where a sub-grid (Editable), wherein I can edit the ones that already exist, and/or add new lines and add them to the Invoice_lines table while it maintains a relationship. 
     
  • Suggested answer
    stampcoin Profile Picture
    5,146 Super User 2026 Season 1 on at
    I suggest two options:
    • Import the table via power app make portal -> Table ->Import data (top command area). if you didn't define the tables.
      then create the relations between the two tables , Parental relationship behavior.
      then build the form and subgrid.
    • Create the table manually, define the relationship. publish it. Then use data management to import the data.
    check the attached image
     
     
    InvoicesApp.png
  • Suggested answer
    Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at
    In Dataverse you would avoid linking the way you have. Pretty much everything links via GUIDs.
     
    Your Invoice record in Dataverese will have a unique identifier (a GUID) automatically assigned to it when it is created (in a field with the same logical schema name as the Table but with an "id" suffix. You may consider putting your existing Invoice_id into the Primary Name column (this column is what users see in the Lookup field on child records, but behind the scenes the linkage is actually the parent records GUID), then using an autonumber on the Primary Name column to continue the sequence.
     
    In Dataverse for your line item Table add a Column of Type Lookup (to Invoice) - this will be your replacement one-to-many relationship.
     
    With that structure adding new records into the subgrid etc will automatically be linked via the Lookup column.
     
    Your issue with importing pre-existing data is to get the Lookup field to map to the correct Invoice record. By default the out of the box mapping for the Lookup on the Child record will usually look for the GUID or Primary Name of the parent record, this mapping can be changed during import so the Lookup on the Child record looks for a different field with a unique value.
    • During Import, set the import so that your Line Item field with the invoice_id is mapped to the Lookup field in Dataverse. (if not using the Primary Name of the Parent record to hold the existing invoice_id, alter the mapping during import to use a different field.
    • Alternatively, after importing the Invoices, export them (this will include the GUID in a hidden column A) and then populate your Line Items with the GUID, and use the field with the parent GUID map to the Invoice.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard