cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Determine Changes EditForm

Hello,

I'm curious what ya'll are doing to detect changes between a submitted record and an EditForm

Example:

  • DataSource: Sharepoint List
  • User Experience:
    • User submits a new record using a Form control
    • User visits a "View/Update" screen which displays records of a certain status (say "Open")
    • User selects a record to View/Update
    • Form is displayed in ViewMode
    • User clicks "Edit" icon
    • Form is displayed in EditMode
  • Goal:
    • I want to control the DisplayMode of the Submit button to ONLY be editable IF something changes between the record stored in Sharepoint and the values in the form. 
    • If user changes a value, then changes it back to the original value, I want the Submit button to go back to Disabled.

Anyone have insights into this pattern? I can think of a few ways to do with a Collection, a timestamp and UpdateIf, but when using a Form control, I don't want to write a formula against each control in this Form.

I thought I could set a variable (varEditForm) to form.Updates when the "Edit" button is clicked, then IF varEditForm = form.Updates, DisplayMode.Disabled... but... I get an "Invalid Argument" error when trying to compare the two.

image.png

They are both records, why not comparable?

image.png          image.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Determine Changes EditForm

Figured out a decent way to do this...

  1. OnSelect of the "Edit" icon/button, Set(varEditForm, frmName.Updates)
    1. This sets a baseline to the forms current status
  2. Set the "Submit" button's DisplayMode to the below code
    1. This could get unwieldy if you have many columns in your DataSource, but works for my use case
If(
    And(
        frmName.Mode = FormMode.Edit,
        frmName.Updates.column1= varEditForm.column1,
        frmName.Updates.column2= varEditForm.column2,
        frmName.Updates.column3= varEditForm.column3,
        frmName.Updates.column4= varEditForm.column4
    ),
  
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

View solution in original post

1 REPLY 1
Highlighted
Super User
Super User

Re: Determine Changes EditForm

Figured out a decent way to do this...

  1. OnSelect of the "Edit" icon/button, Set(varEditForm, frmName.Updates)
    1. This sets a baseline to the forms current status
  2. Set the "Submit" button's DisplayMode to the below code
    1. This could get unwieldy if you have many columns in your DataSource, but works for my use case
If(
    And(
        frmName.Mode = FormMode.Edit,
        frmName.Updates.column1= varEditForm.column1,
        frmName.Updates.column2= varEditForm.column2,
        frmName.Updates.column3= varEditForm.column3,
        frmName.Updates.column4= varEditForm.column4
    ),
  
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

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

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 (6,210)