Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

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

(0) ShareShare
ReportReport
Posted on by

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

Categories:
  • Community Power Platform Member Profile Picture
    on at
    Re: How to import data from Excel to Dataverse with Lookups using Flow?

    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 👍

  • EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: How to import data from Excel to Dataverse with Lookups using Flow?

    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
    on at
    Re: How to import data from Excel to Dataverse with Lookups using Flow?

    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,714 Most Valuable Professional on at
    Re: How to import data from Excel to Dataverse with Lookups using Flow?

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

  • Community Power Platform Member Profile Picture
    on at
    Re: How to import data from Excel to Dataverse with Lookups using Flow?

    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

  • Verified answer
    EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: How to import data from Excel to Dataverse with Lookups using Flow?

    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!

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: How to import data from Excel to Dataverse with Lookups using Flow?

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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
mmbr1606 Profile Picture

mmbr1606 15 Super User 2025 Season 1

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics