cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zbeer02
Level: Power Up

Updating an Excel Table with an Edit Form

Hey,

 

I am building a student roster type app for teachers.

 

I want the teachers to be able to, once a student is accessed, assign a pass.

 

I would assume to use an edit form to do this, but when I use SubmitForm(EditForm1) it creates an entirely new row, where I really just want to update the value of a column of a specific student. 

 

I feel like a Parent or ThisItem value would be neccesary but trying to use Patch as i found that is the right way to do this confuses me immensely.

 

This is mainly because I have one screen to find a student, and then a button to go to that specific student's info.

 

From there I have a button to go to a screen specifically for Passes, but I can only figure out how to make it work with making a whole new set of data rather than updating a value on the table.

 

The column I need to update is Column12 on the data source Table1_1 

 

Please help me, this is a really important project and I really would like for it to work as swiftly as possible.

 

Thank you,

 

Zachary Beer

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Updating an Excel Table with an Edit Form

Hi @zbeer02,

Do you want to select a specific student from a Gallery, then update the corresponding column12 value in your Excel table?

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 consider take a try with the following workaround:

Set the OnSelect property of the "Check mark" button to following formula:

Patch(
          'YourExcelTable', 
           LookUp('YourExcelTable', Student_x0020_ID_x0020_Number = Gallery1.Selected.Student_x0020_ID_x0020_Number),
           {
              Column12: Dropdown1.Selected.Value
           }
)

Note: The Student_x0020_ID_x0020_Number represents the Sutdent ID Number column in your Excel table. The Gallery1 represents the Gallery control in your Screen1.

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

Patch function

 

Best regards,

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.

View solution in original post

8 REPLIES 8
jhall
Level 8

Re: Updating an Excel Table with an Edit Form

I'm not 100%  clear on what's tripping you up, but let's hit the basics first.

 

You don't have to use an Edit form, but you certainly can.  Patch or UpdateIf will also let you do this directly.  Really depends upon your goals for the app.

 

Assuming we have a data source named Students, columns within that source named StudentID/Pass and a field on your screen named SIDNum (similar to your third screen shot), then you could do an UpdateIf along the lines of:

 

ClearCollect(Students,{StudentID:1234,Pass:false});
UpdateIf(Students,StudentID=Value(SIDNum.Text),{Pass:true})

In my above example I'm creating the Collection just as an example, then updating a value within that collection for a record that matches the value of a current text field.  You could just as easily substitute the name of the Collection w/ the name of your data source that exists in SharePoint or elsewhere.

 

This isn't really the BEST way to do this necessarily, but maybe this helps jump-start you into thinking about how you want your app to interact with data.

zbeer02
Level: Power Up

Re: Updating an Excel Table with an Edit Form

So basically I need to clear up some confusion.

 

I have a data source from excel, and Column12 of that data source is a text value. I want to be able to, from the app, use a dropdown to update that text value depending on which student is selected. I attatched a video to hopefully clear up anything confusing. Basically Im trying to modify the "None" so that it updates in all places to wherever their pass is located to until it is updated back to none

zbeer02
Level: Power Up

Re: Updating an Excel Table with an Edit Form

 
zbeer02
Level: Power Up

Re: Updating an Excel Table with an Edit Form

Let me kind of draw it out for you as I realize my latest responses are not the most specific. This is what I want my app to do.

 

I have an excel table attached. This is through Microsoft OneDrive.

 

Each value for student's Column12, which is passes, is at "None".

 

I want to be able to go through the app and find a specific student on Screen 1, tap on the chevron to go to their details page on Screen 2, and tap on the Add Pass button to go to Screen 3. Then, I want to be able to use the drop down to pick a location and then click the check mark. When I click the check mark, I want it to update the Column12 cell for the student I went into on Screen 1 from the original "None" value to the value I select on the drop down. I want the value to be updated on the excel spreadsheet in the oneDrive.

 

I cannot figure out how to do this. I am not set on one way to do this. So if you can help me out to find a way to get this to work in some way, I would greatly appreciate

 

Thank you so much

medivestKT
Level: Powered On

Re: Updating an Excel Table with an Edit Form

Patch(dataSourceName; First(Filter(dataSourceName; Column2 = galleryName.Selected.Column2)); 

{Column12: Dropdown.Selected.Value})

Just change the name of dataSoruceName, galleryName and Dropdown with appropriate name

medivestKT
Level: Powered On

Re: Updating an Excel Table with an Edit Form

Or you can use column1, not column2 to find the record for update.

Community Support Team
Community Support Team

Re: Updating an Excel Table with an Edit Form

Hi @zbeer02,

Do you want to select a specific student from a Gallery, then update the corresponding column12 value in your Excel table?

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 consider take a try with the following workaround:

Set the OnSelect property of the "Check mark" button to following formula:

Patch(
          'YourExcelTable', 
           LookUp('YourExcelTable', Student_x0020_ID_x0020_Number = Gallery1.Selected.Student_x0020_ID_x0020_Number),
           {
              Column12: Dropdown1.Selected.Value
           }
)

Note: The Student_x0020_ID_x0020_Number represents the Sutdent ID Number column in your Excel table. The Gallery1 represents the Gallery control in your Screen1.

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

Patch function

 

Best regards,

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.

View solution in original post

zbeer02
Level: Power Up

Re: Updating an Excel Table with an Edit Form

Thank you so much!! Yours is the one that worked!!!

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 (5,683)