cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Disable / Enable buttons

AccessReport.jpg

 

I have a datacard that contains a on/off switch (yes/no field from my sharepoint list) and a textfield. I would like the Access Report button to be disabled until the on/off switch = On and the Electronic Signature field contains a value.

 

Once the button is enabled and pressed, it would send that data to the SharePoint list.

 

Also, is it possible to make another button available ONLY AFTER the Access Report button is pressed? I want users to access another page using another button.

8 REPLIES 8
JRaasumaa
Memorable Member
Memorable Member

Simply have a variable assigned to yes or no and then use it in the DisplayMode field of whatever needs disabling/enabling.

 

Set your page On Visible to make a variable false (or wherever convenient):

 

UpdateContext({ClickableYesNo: false})

 

Put the variable in the button being pressed to change to true:

 

 

UpdateContext({ClickableYesNo: true})

 

 

And then set your DisplayMode to:

 

If(ClickableYesNo = true, DisplayMode.Edit, DisplayMode.Disabled)

 

This will disable it until true is found in whatever variable name you pick.

 

Hope that leads you to the right answer!

 

 

Anonymous
Not applicable

Should I copy & paste the code into those advanced properties fields? Or should I use the actual names of those fields (instead of clickableyesno)?

 

Copying and pasting did disable the button, but when I update the yes/no field to YES, the button is still disabled.

Anonymous
Not applicable

Also, for the button, if OnSelect = "

UpdateContext({ClickableYesNo: true})", how can I get the button to submit the data to the sharepoint list? Nothing happens when I click on the button.


@Anonymous wrote:

Also, for the button, if OnSelect = "

UpdateContext({ClickableYesNo: true})", how can I get the button to submit the data to the sharepoint list? Nothing happens when I click on the button.


 

You can have a button or actionable item run more than one set of code by using a ; between code.

 

For example:

 

UpdateContext({ClickableYesNo: true}) ; UpdateContext({Clickable2YesNo: true})

That will make both variables listed true.

 

 


@Anonymous wrote:

Should I copy & paste the code into those advanced properties fields? Or should I use the actual names of those fields (instead of clickableyesno)?

 

Copying and pasting did disable the button, but when I update the yes/no field to YES, the button is still disabled.


 

ClickableYesNo is just a random example variable I wrote, you can make it anything you want.

 

 

Anonymous
Not applicable

UpdateContext({DataCardValue2: true});SubmitForm(Form1);Navigate(Screen2,ScreenTransition.Cover)

 

Thsi is my code for the button OnSelect. I need the button to submit the data to a sharepoint list as well as navigating to another screen in the app. However, the data is not being submitted to the list, but the button navigates to the next screen.

 

 

Error.jpg


@Anonymous wrote:

UpdateContext({DataCardValue2: true});SubmitForm(Form1);Navigate(Screen2,ScreenTransition.Cover)

 

Thsi is my code for the button OnSelect. I need the button to submit the data to a sharepoint list as well as navigating to another screen in the app. However, the data is not being submitted to the list, but the button navigates to the next screen.

 

 

Error.jpg


 

What is the yellow exclamation mark saying when you mouse over? That's going to contain the answer as to what's going wrong.

Anonymous
Not applicable

It says "Title:Field Required"

 

Title is the textbox in the screenshot. It is a required field. User click on the yes/no field, enter a value in the textbox, and then click the button to submit and navigate to the next screen. That's the goal.

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 (68,971)