Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 3XyX3K4z/TrrottyNITLNy
Power Apps - Building Power Apps
Answered

Export to Excel

Like (1) ShareShare
ReportReport
Posted on 29 Jan 2025 15:49:40 by 16
I am working on a checklist of items which is part of a gallery called galResults.  I created a flow based on a CoPilot search, but the issue i am having is the OnSelect for a button to initiate the flow.
 
The screen OnVisible where the gallery is
ClearCollect(colExportToExcel,galResults.AllItems)
 
 
The button OnSelect
ClearCollect(ExportCollection,galResults.AllItems);
Set(varJson,JSON(ExportCollection,JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes));
Set(ExportLink, ExportToExcel.Run(JSONData).link);
Launch(ExportLink)
 
This is the line giving me the error about Invalid Number of Arguments, recevied 1 expected 0
Set(ExportLink, ExportToExcel.Run(JSONData).link

My flow was built from this:
  1. Create a New Flow:
    • Go to Power Automate (flow.microsoft.com).
    • Click on Create and select Instant cloud flow.
    • Choose PowerApps as the trigger and name your flow (e.g., “ExportToExcel”).
  2. Add Actions to the Flow:
    • Initialize Variable: Add an action to initialize a variable to store the JSON data from PowerApps.
    • o Initialize variable
    • o - Name: JSONData
    • o - Type: String
    • o - Value: Ask in PowerApps
    • Create CSV Table: Add an action to create a CSV table from the JSON data.
    • o Create CSV table
    • o - From: JSONData
    • o - Columns: Automatic
    • Create File: Add an action to create a file in OneDrive or SharePoint.
    • o Create file
    • o - Folder Path: /YourFolderPath
    • o - File Name: ExportedData.csv
    • o - File Content: Output from Create CSV table
    • Create Share Link: Add an action to create a shareable link for the file.
    • o Create share link
    • o - File: ID from Create file
    • o - Link type: View
    • o - Scope: Organization
    • Respond to PowerApps: Add an action to respond to PowerApps with the shareable link.
    • o Respond to PowerApps
    • o - Add an output of type Text
    • o - Value: Web URL from Create share link
Any help is appreciated.  I am new at all this, so when it comes to these I spend much time looking for a fix but always come back to this forum for help. 
Categories:
  • Verified answer
    Michael E. Gernaey Profile Picture
    35,752 Super User 2025 Season 1 on 08 Feb 2025 at 16:09:31
    Export to Excel
    Hi
     
    Without seeing the trigger itself, the error means that you didn't actually add any inputs into the Trigger. I dont know if you choose V1 or V2 but just adding the Trigger won't make it accept the parameter that you are trying to pass, you need to add it as an input also which is a step I dont see you have done.

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard
Loading started
Loading complete