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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (10,140)