cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venka91
Super User
Super User

Unable to reset controls

Hello

I am trying to reset the Disabled Text Controls when i navigate between Screens. But they are not seems to be working. Not sure where i am doing wrong. Please assist. Posting screenshots.

 

Text box control to Input the Employee ID.

User clicks on Get Details Button

Now the Details of employee like, Name, Phone number are populated in text boxes. (Disabled as user should not edit)

User input additional details of employee, like last working and Reason for resignation

User click on Update Button. Details will be updated into SharePoint List.

 

Now when i naviagate between the Screen, the value showed on Text controls with employee details stays ever.

1 ACCEPTED SOLUTION

Accepted Solutions

@venka91 ,

I will have a go at this one for you and understand you are using "unbound" text boxes (not in a Form).

As @Jeff_Thorpe noted, you need a "stored" value to set as the Default of the control.

You can also control the ability to edit the Text Box (as @Drrickryp noted)  in its DisplayMode (which can be Edit, View or Disabled) - either of the last to are what you need to prevent editing - they just display differently.

So firstly, if you are selecting the record from a LookUp, you can set a Variable to the (entire) record contents

Set(
   varRecord
   YourLookUpCode
)

The Default of your text boxes would then be (example for Name)

varRecord.Name

So taking this further, if you set another Variable when you want to "clear" the contents.

Set(varClear,true)

you can then conditionally set the contents in the Default

If(
   varClear,
   "",
   varRecord.Name
)

Is this what you are asking?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

6 REPLIES 6
Jeff_Thorpe
Super User
Super User

You can't directly set the value of a control from a button. The value of a text control is determined by the formula in the Default property.  In your case it is FrmEmp.Name, so if that property still contains the Name it will continue to be displayed when you reset the control. If you are using a form then when you save the data to SharePoint try resetting the form ResetForm( FrmEmp).



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

You got my point right . But I am not using form to store the data to share point . 

the button just get the basic info of employee and displays it . Additional input given in control and will be appended to share point list for the selected record .

 

so is there no way to reset these values or any other way you could suggest to get the same requirement achieved ? 

Hi @venka91 

Set the default mode of the form to View.  This will prevent editing of the cards.  For the controls you want to be able to set to blank,  set the display mode of the card to Edit and put 

If(!IsBlank(Parent.Default),"") as the default property of the control inside the card.
venka91
Super User
Super User

But I am not using forms . I am using custom controls for all values to be displayed from data source .

 

i only have the problem resetting these custom control text box as the record I pulled using look up function will be displayed as text . So I want to make the lookup value blank navigate between screen so the text box controls will not display the values and shows empty.

@venka91 ,

I will have a go at this one for you and understand you are using "unbound" text boxes (not in a Form).

As @Jeff_Thorpe noted, you need a "stored" value to set as the Default of the control.

You can also control the ability to edit the Text Box (as @Drrickryp noted)  in its DisplayMode (which can be Edit, View or Disabled) - either of the last to are what you need to prevent editing - they just display differently.

So firstly, if you are selecting the record from a LookUp, you can set a Variable to the (entire) record contents

Set(
   varRecord
   YourLookUpCode
)

The Default of your text boxes would then be (example for Name)

varRecord.Name

So taking this further, if you set another Variable when you want to "clear" the contents.

Set(varClear,true)

you can then conditionally set the contents in the Default

If(
   varClear,
   "",
   varRecord.Name
)

Is this what you are asking?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

WarrenBelz
Super User
Super User

Hi @venka91 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,628)