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
Highlighted
Resolver I
Resolver I

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
Highlighted
Resolver I
Resolver I

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

Highlighted
Community Support
Community Support

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.
Highlighted
Anonymous
Not applicable

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?

 

@Anonymous

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,868)