cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Help exporting to Excel file

Hello.

 

I’m trying to build my first PowerApp to fill a front office management need.

I’ve build (design) my app, with some text boxes, dropdown menus and a button.

Also, I was able to somehow connect an Excel file saved at OneDrive for Business.

The button is working as expected, changing properties of different items when clicked.

 

What I need is to save some text information to that Excel file, but I guess I’m missing some collect know-how.

The Excel file is very simple with some columns to be recorded (user name; date when first clicked the button, date when clicked the button second time, and the dropdown option).

Can you help me understand how to export this information?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Help exporting to Excel file

HI I don't really understand your issues.

Do you want to add ned lines in your excel table ? If so, you can first try using a Form control in your powerapps, linked to your Excel connection. Change the FormMode property of the form control to New and add a button with the OnSelect property set to SubmitForm(FormName) to add a new item.

 

You can follow the same indications but change the FormMode to Edit to edit existing lines.

 

If you are advanced with PowerApps, you could use the Patch() function

 

Hope it helps

 

regards

View solution in original post

3 REPLIES 3

Re: Help exporting to Excel file

HI I don't really understand your issues.

Do you want to add ned lines in your excel table ? If so, you can first try using a Form control in your powerapps, linked to your Excel connection. Change the FormMode property of the form control to New and add a button with the OnSelect property set to SubmitForm(FormName) to add a new item.

 

You can follow the same indications but change the FormMode to Edit to edit existing lines.

 

If you are advanced with PowerApps, you could use the Patch() function

 

Hope it helps

 

regards

View solution in original post

Community Support Team
Community Support Team

Re: Help exporting to Excel file

Hi @Anonymous,

Could you please share a bit more about your scenario?

Do you want to patch record into your Excel table via clicking the Button control?

Further, could you please share a screenshot about your app's configuration?

Based on the needs that you mentioned, I suppose that you want to save a new record into your Excel table or update an existing record in your Excel table via clicking a Button, is it true?

Based on the needs that you mentioned, I think the Patch function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

If(
   IsBlank(LookUp(YourExcelTable, UserName = UserNameTextInput.Text)), /* Check if there already has a record existed in your Excel table */
   Patch(         /* <-- Add new record */
           YourExcelTable,
           Defaults(YourExcelTable),
           {
             UserName: UserNameTextInput.Text,
             FirstDate: Now(),
             ...
           }
    ),
    Patch(     /* <-- Update existing record */
           YourExcelTable,
           LookUp(YourExcelTable, UserName = UserNameTextInput.Text),
           {
             UserName: UserNameTextInput.Text,
             SecondDate: Now(),
             ...
           }
    )
)

Note: I assume the UserName is a column in your Excel table, which could identify one record uniquely. In addition, I assume that you want to save a record into your Excel table when you firstly click the Button, and want to update an existing record when you secondly click the button.

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TopShelf-MSFT
Level 10

Re: Help exporting to Excel file

Thanks for your post @Anonymous - can you review the responses from @MatthieuMegaly_ and @v-xida-msft and advise if they solve your issue?

 

@TopShelf-MSFT

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,956)