web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update Row in Exccel
Power Apps
Answered

Update Row in Exccel

(0) ShareShare
ReportReport
Posted on by 58

Hello All,

 

I am trying to build a Power Apps canvas app to connect to my Excel spreadsheet. The Excel spreadsheet has the following headers:

  • Start Time
  • End Time
  • Comments 1
  • Comments 2

I want the app to function as follows:

  • When I click a button, the app should capture the current date and time and populate the Start Time column in the Excel spreadsheet.
  • Once I have filled in the Comments 1 and Comments 2 fields, the app should update the same row in the Excel spreadsheet where the Start Time is populated.
  • Similarly, when I have completed my activity and click an End button, the app should capture the current date and time and populate the End Time column in the Excel spreadsheet, in the same row where the Start Time and Comments 1 and Comments 2 fields are populated.

Basically in my power apps have 3 buttons as per the below

1 to update Start Time

1 To update End Time

1 to update the comments fields.

 

Really Appreciate support in this request.

 

Thanks & Regards

Ganesh G V

Categories:
  • GaneshaGV123 Profile Picture
    58 on at

    @ManishSolanki  Your expertise would be invaluable here.

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @GaneshaGV123 ,

     

    Could you please share more details about your scenario? In addition to these buttons, what controls do you have in your App? Will you always add a new row to Excel table when pressing the Start button?

     

    If you will always update current time as a new row in the table, then the formulas would be as follows:

    Start Button:

     

    Set(varNewReocrd, Patch(ExcelTabel, Defaults(ExcelTable),{'Start Time': DateTimeValue(Text(Now(),DateTimeFormat.ShortDateTime24))}))

     

     

    Comments Button:

     

    Patch(ExcelTabel, varNewReocrd,{Comment1: Comment1TextInput.Text, Comment2: Comment2TextInput.Text})

     

     

    End Button:

     

    Patch(ExcelTabel, varNewReocrd,{'End Time': DateTimeValue(Text(Now(),DateTimeFormat.ShortDateTime24))}); Set(varNewRecord, Blank())

     

     

    Besides, to prevent users from pressing Comments button and End button before Start button, you can set the two buttons' DisplayMode property as below:

    If(IsBlank(varNewRecord), DisplayMode.Disabled, DisplayMode.Edit)

     

    Best regards,

  • GaneshaGV123 Profile Picture
    58 on at

    Hi,

    Thank you for your previous response. That is what I am trying to build. I have followed all of your instructions and used the same formulas, but only the "Start" button is working. The "Update" and "End" buttons are giving errors, as shown in the attached image. Could you please help me troubleshoot this issue?

     

    GaneshaGV123_0-1696504161007.png

    GaneshaGV123_1-1696504192295.png

     

    Thanks & regards

    Ganesh G V

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @GaneshaGV123 ,

     

    Do you have a system generated PowerAppsId_ column in the Excel table? You can use this column or a default unique key values column for getting the new created record instead:

     

    Start Button:

    Set(varNewReocrd, Patch(Time, Defaults(Time),{'Start Time': DateTimeValue(Text(Now(),DateTimeFormat.ShortDateTime24))}))

     

    Update Button:

    Patch(Time, LookUp(Time,PowerAppsId_ = varNewReocrd.PowerAppsId_, {Comment1: TextInput1.Text, Comment2: TextInput2.Text})

     

    End Button:

    Patch(Time, LookUp(Time, PowerAppsId_ = varNewReocrd.PowerAppsId_, {'End Time': DateTimeValue(Text(Now(), DateTimeFormat.ShortDateTime24))}); Set(varNewRecord, Blank())

     

    Best regards,

  • GaneshaGV123 Profile Picture
    58 on at

    Thanks you it is working as expected !! Now I have a new question 

    I have a PowerApps form/canvas with multiple start and stop time buttons for different activities. The activities are:

    1. Prerequisit (Start, Pause, Resume, End)
    2. Actual Work (Start, Pause, Resume, End)
    3. Post Work (Start, Pause, Resume, End)

    I want to enable the buttons for the second activity once the first activity is completed (by hitting the stop button for the first activity). I also want to display which button I have pressed on the screen.

     

    GaneshaGV123_0-1697107819358.png

    Regards

    Ganesh G V

  • GaneshaGV123 Profile Picture
    58 on at

    Hello,

     

    Any Help or Suggestion would be appreciated.!!

     

    Regards

    Ganesh G V

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard