0

I am not a coder, but trying to understand the logic and write the correct formula in PowerApps.

When I select 'Edit' from my 'Gallery1', it opens my 'BuildForm' screen in Power Apps. I want the SAVE button on my 'BuildForm' screen to DISABLE when viewing the form.

Right now I have my SAVE button DisplayMode control set to:

If(BuildForm.Valid,DisplayMode.Edit, DisplayMode.Disabled)

It is disabled until the form is fully completed by the user.

How do I tell it to also disable the SAVE button when someone is only Viewing the information in the BuildForm?

5
  • How do you differentiate if user is viewing the form or editing the form? Do you have separate buttons (view & edit) in gallery to navigate to same screen? Did you set the form mode to edit or based on any conditions? Commented Apr 23, 2021 at 3:18
  • @GaneshSanap User is viewing the form. From the gallery, yes, i have two separate buttons for view and edit. The DEFAULT control on the form is set to 'Edit'. Is that something I need to update? Commented Apr 23, 2021 at 14:52
  • Yes, when you click on "View" button from gallery, set FormMode/Mode of form control to FormMode.View & when clicking on "Edit" button, set FormMode/Mode of form control to FormMode.Edit. Check this documentation for more information on Form modes. Commented Apr 23, 2021 at 14:55
  • Ganesh, this is what I have ONSELECT: Navigate(BuildForm, ScreenTransition.Fade); ViewForm(BuildForm) Commented Apr 23, 2021 at 15:02
  • Ok, then try my below suggestions & let me know if it works for you. Commented Apr 23, 2021 at 15:33

1 Answer 1

1

If you want to set the button property based on form mode then you can use the FormMode.

Example:

If(BuildForm.Valid || BuildForm.Mode = FormMode.Edit,DisplayMode.Edit, DisplayMode.Disabled)

OR

If(BuildForm.Valid || BuildForm.Mode = FormMode.Edit || BuildForm.Mode = FormMode.New,DisplayMode.Edit, DisplayMode.Disabled)

You can add/remove conditions in above formula as per your requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.