cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sauerjob
Regular Visitor

Adding Excel files to a folder in Sharepoint list

Hi,

 

I have a template excel file and I want to use flow to create the exact excel file and add it to the sharepoint list. The name of each of the created excels is given from power apps. The problem is I can‘t seem to add new Excel files from trigger in powerapps. How do I create an excel file of this template in sharepoint?

 

Thanks

2 REPLIES 2
ArchitectMadhan
Responsive Resident
Responsive Resident

Hi @Sauerjob ,

 

Here is the link having the steps to Create Excel Workbook dynamically from the Power Automate Flow and the name of the file can also be got from Power Apps and Passed to Power Automate. But as you mentioned you need to have Excel Workbook template already stored in the SharePoint document library. But dynamically we can add rows to Excel Workbook and make a copy of the excel to other folder in any document library within SharePoint.

 

https://powerusers.microsoft.com/t5/General-Power-Automate/Creating-an-excel-sheet-when-a-file-is-dr...

But you will directly create the Excel Workbook from Power Apps, May be you can collect the details for adding rows to excel workbook can be collected in SharePoint list of PowerApps collection and then pass it to the Power Automate Flow on the button click from PowerApps.

 

If you find my solution helpful for resolving the issue, then please consider giving thumbs up and Accept it as the solution to help the other members find it more quickly.

v-bofeng-msft
Community Support
Community Support

Hi @LukasSliuzas :

Do you wish to upload multiple excel files locally to a SP library by an canvas app?

If so,I've made a test for your reference:

vbofengmsft_0-1627883887582.png

1\Add a Attachment control(AttachmentControl)
2\Add Timer control(Timer2)

Duration

3000 /*loop in 3s*/

OnSelect

Clear(TheFiles);Set(TheCount,1)

OnTimerEnd

Set(TheRecord,Last(FirstN(AttachmentControl.Attachments,TheCount)));Set(TheURL,TheRecord.Value);Collect(TheFiles,{FileName:TheRecord.Name,FileContent:Substitute(JSON(Image1.Image,JSONFormat.IncludeBinaryData),"""","")});Set(TheCount,TheCount+1);Set(TheFilesJson,JSON(TheFiles,JSONFormat.IncludeBinaryData))

Repeat

TheCount<CountRows(AttachmentControl.Attachments)

3\Add an image control(Image1)

Image

TheURL

4\Create a flow(PowerAppV2 -> Compose)

vbofengmsft_2-1627883887593.png

The Schema

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "FileContent": {
                "type": "string"
            },
            "FileName": {
                "type": "string"
            }
        },
        "required": [
            "FileContent",
            "FileName"
        ]
    }
}

5\Go back to the app and add the flow into the app

6\Add a button(Button5) and set it's Onselect property:

'PowerAppV2->Compose'.Run(TheFilesJson)

Select the timer button and then wait for it to end automatically.Finally select the Button5.

vbofengmsft_3-1627883887422.png

vbofengmsft_4-1627883887615.png

I think this link will help you a lot:
Creating multiple file attachment without edit forms 

Best Regards,

Bof

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.

Top Solution Authors
Users online (2,151)