cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Buttons not working in View mode

I have a sharepoint list that i have modified the forms in PowerApps.  This has allowed me to add 4 buttons to the top of the form which show and hide different fields when clicked (this breaks up the fields into different 'pages').  When a button is clicked it sets a variable which each field looks at to see if it is visible or not.

 

The issue is that when viewing the data (not new form or edit form) the buttons do nothing!  I presume they are somehow disabled from the OnView, but i cant work out how or how to change it!.

 

Any help greatly appreciated 🙂

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

sussed it!!!

 

I put the buttons in the form, all i had to do was move them out of the form to the page and it all works 🙂

 

Thanks for all your input though!

View solution in original post

8 REPLIES 8
Super User III
Super User III

You are not supposed to change a field if in view mode. But can you show a screenshot of the formula on the displaymode of the button?

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi

The DisplayMode of the button (main button) has this (this disables the button when pressed):

If(varTab = "main", Disabled, Edit)

 

and the OnSelect (this sets the varTab variable):

Set(varTab, "main")

 

The fields have this on their Visible (this displays the field if the relevant button has been pressed (is disabled):

Btn_main.DisplayMode = DisplayMode.Disabled

 

Change the DisplayMode of the button to:

 

If(varTab = "main",&&FormName.Mode<>View, Disabled, Edit)

 

Change the FormName to your actual form name

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

That doesnt work - not sure what you are trying there, but essentially you are saying if the form is in view mode the buttons will always be in Edit mode?

Yes.

If I misunderstood you kindly restate your point

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

ok to explain further.  I have a sharepoint list that has 40 columns.  To make the form easier to fill in and use, i have split those 40 fields up into 4 different sections.  Each field is displayed according to if the relevant button is selected (the selected button becomes disabled and the visible state of each field is set according to the buttons disabled state).

 

e.g. user presses ButtonA, this disables ButtonA (no need to press it again!) and any form field that has its Visible set to true if ButtonA is disabled becomes visible.  This all works fine when editing a row or adding a new row.  Every time a user presses a button, that button disables, all the other buttons enable and the relevant fields hide or show.

 

The issue is, when viewing the form in View mode (ie the user just clicks to view the item) these button do nothing - they dont even show the finger icon when hovered over. This means they can nolonger view all the data as some is hidden and the buttons dont do anything.

I think what is needed is a variable to reverse Set(varTab, "show") in order to show the fields and change the button mode.

 

I suggest you change the variable to Boolean, true false.

Set(varTab, false)

 

Insert another that changes the variable

Set(varTab, true); ViewForm (YourForm)

 

Then DisplayMode of the button ;

If(varTab =true, Disabled, Edit)

 

With that when the new button is pressed, the field would show for View mode

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

sussed it!!!

 

I put the buttons in the form, all i had to do was move them out of the form to the page and it all works 🙂

 

Thanks for all your input though!

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (5,497)