cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sr12
Helper III
Helper III

How to update an excel table through PowerApps?

Hello,

 

I am creating an app and its connected to an excel workbook on OneDrive for business. When I add new data to the application, the excel table is not updating. I tried hitting the refresh button in the data source section in PowerApps but still not working.  So how can I update the excel table when adding new data into PowerApps?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

@sr12 , Below is my Excel file and power app where i am interacting to do CRUD operations.

Bilakanti_1-1629705342009.pngBilakanti_2-1629705373426.png

Patch(
    Table1,
    Defaults(Table1),
    {
        ID: TextInput4.Text,
        Name: TextInput4_1.Text,
        Address: TextInput4_2.Text
    }
)

View solution in original post

12 REPLIES 12
Bilakanti
Responsive Resident
Responsive Resident

@sr12 , You can use Patch function to create/update/delete rows in excel using Power Apps, can you let me know what is the error that you are facing?

 

 

@sr12 , Below is my Excel file and power app where i am interacting to do CRUD operations.

Bilakanti_1-1629705342009.pngBilakanti_2-1629705373426.png

Patch(
    Table1,
    Defaults(Table1),
    {
        ID: TextInput4.Text,
        Name: TextInput4_1.Text,
        Address: TextInput4_2.Text
    }
)

Hi @Bilakanti 

Thank you for your reply.

 

I'm sorry but I'm new to PowerApps and its my first time using the Patch function. I did the code as shown below and its giving me errors all over.  I have used the names of the columns and the names of the Data Card Values.

Can you please advise what is wrong?

 

Patch( Table1, Defaults(Table1), { Leave Type: DataCardValue26, Employee Name: DataCardValue19, Position: DataCardValue22, Leave Start Date: DateValue8, Leave End Date: DateValue5, No. of Days for Leave Purpose: DataCardValue21, Details of Leave: DataCardValue25, Reporting Back to Work On: DateValue7, Telephone Number During Leave: DataCardValue24, Submitted to: ComboBox2 } )

Bilakanti
Responsive Resident
Responsive Resident

@sr12 , From the above syntax , i can see you are using Just Datacards controls, but you need to use DataCardControl Values. 

 

If it's Text Control then : DataCardValue.Text;

If it's dropdown Control then : DataCardValue.SelectedItem.Value;

 

Your code will work if you make these changes, If you are not aware, then if you share the screenshot of the form, so that I will modify your code accordingly.

@Bilakanti, Here is a screenshot of the code.

 

Screenshot (2).png

Bilakanti
Responsive Resident
Responsive Resident

@sr12 Everything looks fine, except last column "Submitted to: ComboBox2" You are referring to direct control rather than it's value.

@Bilakanti, I've added .SelectedItem to ComboBox2. Its still not working.

 

Anyways thank you for your help!

Bilakanti
Responsive Resident
Responsive Resident

@sr12 .SelectedItem will return record, which is not correct, you need something like .Selected.Value.

@Bilakanti , Still the same.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,439)