cancel
Showing results for 
Search instead for 
Did you mean: 

Allow events in form View Mode

Allow events (e.g. OnSelect for buttons and icons) to occur when contained within a form in View Mode.

 

For example, if using custom cards to create form section headers, and I want to be able to collapse or expand the sections when in View Mode.  This method (h/t @R3dKap ) works great but only in Edit or New mode because View mode overrides even the card's explicit setting of DisplayMode.Edit.

Status: New
Comments
DavesTechTips
Super User

Hello @edbellman 

 

You can currently do this by setting the card that contains the elements that you want to make actionable to not inherit the DisplayMode of the form by change the DisplayMode formula of the card from 

Parent.DisplayMode

to

DisplayMode.Edit

 

Let me know if you don't come right.

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1

edbellman
Advocate II

@DavesTechTips , thanks for the reply.

 

Your suggestion was the first thing I tried before reaching out and unfortunately, it does not work (see my "this method" link above for more info). Maybe it is because this is a SharePoint list form app using the SharePointIntegration for "OnView", etc.?

 

I just tried it again this morning to make sure I didn't mess something up yesterday and am getting the same result.

 

 

The FormMode appears to override the DisplayMode in this scenario, see below.

FormHeaderSPI.gif

edbellman
Advocate II

Adding a few more pics here as the forum is acting strange and not letting me add them to my reply above.

 

SPI-ViewForm1.pngSPI-ViewForm2.pngSPI-ViewForm3.png

TickboxPhil
Advocate IV

Good one @edbellman for suggesting this - it's a basic requirement, so not even restricted to SharePoint - it applies to all apps. Objects should be allowed OnSelect at least, even when the Form is in View not Edit mode.

 

For example, a Help icon (whose OnSelect opens up the message window) when displaying data to the users before they edit it (see, I told you, basic!):

 

TickboxPhil_0-1614157897493.png

Microsoft support has declared this "locking Events in View Mode" as "by design" (haha), but I see it as necessary. To work around this (the users and client will not accept this app without working help icons) I put the Icons outside the form, but of course the form cards move around when changing Mode (especially thanks to the standard hidden validation textboxes). A workaround for this workaround (facepalm!) is to manually set the Y coordinates of the Icon, but this will cause other problems. Similarly, @DavesTechTips workaround is a good idea I have seen, but again will have issues way beyond the simple allowing of OnSelect within a View Form.

 

I really don't see any reason to not allow OnSelect to work on objects within FormMode.View. This small oversight can easily derail adoption of Power Apps. Hopefully it will be allowed soon!