cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cmndflom
Frequent Visitor

Upload Excel file from PowerApps - append rows into existing SharePoint list

Hi All,

I am trying to create a flow that reads an Excel file from Power Apps and appends rows from the Excel file into an existing SharePoint list.

 

I have figured out the first part (uploading within PowerApps and reading the rows in Power Automate) but I am stuck on the next portion of the logic. I would also like to build logic that checks that the excel file being uploaded has the same number of rows as the SharePoint list. 

 

The way I currently have my flow setup is that it reads the Excel file from Power Apps (using JSON) and creates a new SharePoint  document upload. I was then trying to get the rows from the newly created SharePoint document and append them to my other main SharePoint list. I am not sure if this is the best way to do this and this is where I am a bit stuck. How do you easily read from a SharePoint document and then convert that to a SharePoint list? Any input would be greatly appreciated!

cmndflom_0-1629235325302.png

 

3 REPLIES 3
v-qiaqi-msft
Community Support
Community Support

Hi @cmndflom,

Do you want to import excel data to existing SP list?

Could you please share a bit more about your scenario?

Even though you have been able to upload files to SharePoint document library, I don't think it is an most efficient way to achieve this using JSON.

I think the most efficient way is to use PowerApps directly.

1). Format the excel data in Table

2). Create connection with the excel file(one drive) and your existing SharePoint list

3). Save the data in excel as a cllection:

ClearCollect(Data1,tablename)

4). Write the excel data to SharePoint list:

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

You even don't need to upload the file within PowerApps to SharePoint library.

Hope it could help you at some degree.

Best Regards,
Qi

Due to restrictions within my organization, I am trying to avoid using OneDrive as a data source. Users will be uploading updated excel files and I want to take the rows from these new files and append them to an existing SharePoint list. The only way I have been able to get this upload feature to work (and avoid OneDrive) is by saving the file as a document library item using JSON to pass the information from PowerApps to Power Automate. I am looking for help in converting the file from a document library item so that I can read the rows in the file and append them to a SharePoint list.

Hi @cmndflom ,

 

Can you please share the steps and code to upload the excel into the SharePoint from PowerApps. Since upload is successful but file content is not in correct format. so unable to process the file ..

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,891)