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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Import data from Excel...
Power Apps
Answered

Import data from Excel or CSV and Update SharePoint List

(0) ShareShare
ReportReport
Posted on by 45

Hi all

I have rows of data in an excel file and I would like to update my SharePoint List with the contents of this file using Powerapps.

 

I am able to connect to the excel file as a datasource in Powerapps using the OneDrive for Business Data Source, but I am struggling with how to push this data to my SharePoint List. I can't easily do a Collect or Patch because there are some complex datatypes in the SharePoint List like Choice and Lookup for which I cannot know the iterator.

 

e.g. I have fields called "ChoiceField", "NumberField", "TextField", "Title", "YesNoField" in my excel file and a SP List with the same names. 

 

What is the best way to update my SP List? 

 

Thanks

Andrew

Categories:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    on at

    Hi @agaskelluk ,

    Do you want to write data in excel to sharepoint list?

    I've made a similar test for your reference:

    1)create connection with the excel file(one drive) and sharepoint list

    2) save the data in excel as a cllection:

    ClearCollect(Data1,tablename)

    2)update data:

    ForAll(Data1,Patch(listname,Defaults(listname),
    {textfield:textfield,choicefield:{Value:choicefield},datefield:datefield,
    numberfield:Value(numberfield),lookupfield:LookUp(Choices(listname.lookupfield),Value=lookupfield)}
    )
    )

    I use some special data types as example, like text type,choice type, date type, number type, look up type.

     

     

    Here's a doc about creating multiple records at once:

    https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch/

    Here's a doc about defining special data type in sharepoint:

    https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

     

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

     

  • agaskelluk Profile Picture
    45 on at

    Hi @v-yutliu-msft 

    That was extremely useful and helped me solve this. Thanks so much!

     

    Here are some additional observations and questions however:

     

    1) Do I really need to create a collection? Can't I access the data directly from the excel datasource ie 'tablename'?

    2) I handled booleans like this, I don't know if there is a better way:

    Conversion: If(
    Conversion = "Yes",
    true,
    false
    )

    3) I had some odd behaviour with DateTime fields in the SP List. I have three DateTime Fields. The first is required the others are not. The one that is required got interpreted by PowerApps as a text field, so I could do this:

    myDateTime: myDateTime

    but the other two needed a cast like this:

    myDateTime: DateValue(myDateTime)

     

    Thanks

    Andrew

     

  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @agaskelluk ,

    1)Yes. I'm afraid it's not supported to save data from excel to SharePoint directly in PowerApps currently. You need collection as a temporarily stored place.

     

    2)Yes. I've made a similar test, this is the best way.

    Here's formula that I tried:

    ForAll(c,Patch(Table1,Defaults(Table1),{jus:If(Column1="Yes",true,false)}))

     

    3)I've made a similar test but not found the problem as your description.

    Whether using DateValue is determined by the format of the filed in Excel.

    If the data in Excel is already formatted to datevalue, you could use myDateTime directly.

    If the data in Excel is just a text value, you need to use DateValue(myDateTime).

     

    Best regards,

    Community Support Team _ Phoebe Liu

  • agaskelluk Profile Picture
    45 on at

    @v-yutliu-msft That's great, thank-you.

     

    Regards

    Andrew

  • v-yutliu-msft Profile Picture
    on at

    Hi @agaskelluk ,

    Do you have other questions?

    If your problem has been solved, please mark my answer.

    Thanks!

     

    Best regards,

    Community Support Team _ Phoebe Liu

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard