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 / When editing a form, m...
Power Apps
Unanswered

When editing a form, make a field required to change its value, if any other field changes on the form

(0) ShareShare
ReportReport
Posted on by

I have an app that is connected to a SharePoint list. When the user clicks an edit icon, I change the form to an EditForm. At the same time, I want to ensure that a column in the EditForm must be changed, if any other column had a change. 

For example, all entries have an effective date. If someone is making a change to the record, they must also change the effective date. I am unsure on how to force a required change to that datacard. Any ideas?

Categories:
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @AnnetteM - I would approach the problem this way:

     

    On the OnSelect property of your SubmitForm Button/Icon, enter:

     

    If(
     'Your Effective Date DataCard'.Update = 'Your Effective Date DataCard''.Default && Or(
     'DataCard1'.Default <> 'DataCard1'.Update,
     'DataCard2'.Default <> 'DataCard2'.Update,
     'DataCard3'.Default <> 'DataCard3'.Update,
     'DataCard4'.Default <> 'DataCard4'.Update
     ),
     Notify(
     "Save disabled. Please update the 'Effective Date' field",
     NotificationType.Warning
     ),
     SubmitForm(Form1)
    )

     

  • AnnetteM Profile Picture
    on at

    I was thinking about that but I have over 50 columns on a tabbed form that would have to be checked. That seems like a lot, and would it be app intensive?

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @AnnetteM - you would have to manually accommodate for all 50 data cards in the formula I am afraid. Given the formula is looking at the output of specific specific controls (rather than running queries back to your data source), I would not expect this to be a resource intensive.

     

    Another option is leverage the Unsaved property of the EditForm control. 

     

    For example:

     

    1. On the OnSelect property of your Submit Button, enter:

     

    If(
     Form1.Unsaved,
     UpdateContext({ctx_show_dialog: true})
    )

     

    2. Add a Container control into your Screen.

     

    3. Insert a Button control and a Date Picker control into that Container

     

    4. On the OnSelect property of the Button control, enter:

     

    If(
     Len(DatePicker1.SelectedDate) = 0,
     Notify(
     "Please select a date",
     NotificationType.Warning
     ),
     SubmitForm(Form1);
     Reset(DatePicker1);
     UpdateContext({ctx_show_dialog: false})
    )

     

    5. On the Visible property of the Container control, enter:

     

    ctx_show_dialog

     

    6. On the OnSuccess property of the EditForm control, enter:

     

    Notify(
     "Saved",
     NotificationType.Success
    );
    Patch(
     'Your Data',
     Gallery1.Selected, //this examples assumes you're populating the Item property of your Edit Form with a Gallery selection
     {'Effective Date Column': DatePicker1.SelectedDate}
    )

     

    7.  Remove the "Effective Date" DataCard from your Edit Form

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard