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 / How to import data fro...
Power Apps
Answered

How to import data from Excel to Dataverse with Lookups using Flow?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all, I'm trying to create a flow to enable a school to import data from Excel into Dataverse.

 

I'm stuck on Lookup fields. For example I have a GroupType table referenced by a Group table.

 

My approach

I import the data from the groupTypes Excel file into Dataverse which generates the UIDs.

I then read data from dataverse into an array comprising groupTypeDescription and grouptypeid.

 

Challenge

When I import Groups I want to be able to pass the groupTypeDescription from the groups spreadsheet column and return the grouptypeid from the array and then use that to populate the lookup field on the groups Dataverse table.

 

The 'variables()' expression looks a likely candidate but I can't seem to crack it.

 

There are similar posts on here but I can't find the answer.

 

Can anyone offer any advice please?

 

Many thanks,

Jim

I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Anonymous Using Data Flows and Power Query maybe a better solution for your requirements. 

  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @Anonymous,

    You don't need to populate an array of group description and group type. Instead to simplify the flow, use the "List Rows" action to get the required group ID and then use the group ID directly in your "Add a row" action.

    Remember to bind a lookup field that format is: /PluralPhysicalTableName(guid). Example:

    /cr23s_grouptypes(98bd54a1-2c1b-4e5a-bbb5-2b7b292d5119)

    Another trick as well is with alternate keys. Instead of retrieving the group ID, if the description is unique, set an alt key on it and then just set the lookup. Example: 

    /cr23s_grouptypes(cr23s_alternatekeyname='descriptionfromexcel')

     

    Dataflows is another good option as stated by @CNT if you need to run under a regular interval, but Power Automate is also a viable option where you have more control and can get a more performant process.

    Hope this helps!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    A great many thanks CNT and EricRenier for your help here. I'm up and running with a BUT 😉

     

    I had previously used dataflows but wanted more control as you identified.

     

    List rows and an expression referring to the output was a solution BUT I'd love to implement the alternate keys approach which seems cleaner and more concise however I just can't get this to work.

     

    The flow returns Error in query syntax. Any idea what I'm doing wrong below?

     

    The lookup table plural name is hdc_reggrouptypes, the key is hdc_keyGroupType. I've tried all lowercase also -

     

    syntax.pngflowError.png

    FYI, I used the list rows approach to retrieve the regOccurrence key above 🙂

     

    Cheers,

     

    Jim

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    I think you're missing a "/" before hdc_reggrouptypes

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, good spot but I tried with a / before and same error unfortunatley

     

    The regOccurrence value that uses list rows also does not include a / and works so I don't think it's required Eric

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Not sure if you solved it finally, but the other thing could be the case on the key name (ie hdc_keygrouptype)? 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Eric  I'm happy with the List Rows solution referencing the output as first(...) which is working well

     

    Since then, I do now have the /xxx_odatapluraltablename(xxx_alternatekeyname='SearchText') approach working in other solutions.

     

    One problem is that the prefix the system uses can sometimes differ from the 'Plural Display Name' displayed when you create or edit a table and exposed in odata. For example 'Plural Display Name: xxx_groups', actual plural name 'xxx_groupses' !

     

    My solution To retrieve the right name every time I create a List Rows action on the table in question, run it, and then look at the odata string in the raw inputs 😉

     

    thanks again for your excellent steer here, Jim 👍

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard