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

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
eka24
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

 

eka24
Super User III
Super User III

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?

eka24
Super User III
Super User III

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.

eka24
Super User III
Super User III

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (67,881)