cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Flowbginner
Advocate V
Advocate V

Make some Text Input fields read-only in Edit Forms

Hello All

 

I use an Edit Form with a SharePoint list as data source. Users fill in the form completely. Once done they click on a button. The top 3 text inputs are saved in a variable and have the default property set to their variables. 

Now I need these top 3 text inputs set to read-only so they can only fill in the other fields.

When trying this out I can still fill in the top 3 text-inputs. Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Flowbginner
Put this code in the OnVisible property of your screen

Set(readOnlyFields,false);


Next, put this code in your Add A Service button

Set(readOnlyFields,true);



Finally, put this code in the DisplayMode property of each of your 3 DataCard value fields

If(readOnlyFields=true,View,Edit);



—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

8 REPLIES 8
mdevaney
Super User
Super User

@Flowbginner
Put this code in the OnVisible property of your screen

Set(readOnlyFields,false);


Next, put this code in your Add A Service button

Set(readOnlyFields,true);



Finally, put this code in the DisplayMode property of each of your 3 DataCard value fields

If(readOnlyFields=true,View,Edit);



—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

Thank you so much!!!! It works!Smiley Very Happy

@mdevaney  do you know how I can merge the inputs from an edit form togther with Text Inputs outside the edit form so it only writes 1 single item in a SharePoint list?

The same solution worked for 2 days, and then on day 3 it has stopped working. Nothing was changed.
But now, even the Status="Approved" forms have editable fields.
OnVisible property of screen:
If(StatusValue.Selected.Value= "Approved" Or StatusValue.Selected.Value= "Rejected", Set(readOnlyFields,true), Set(readOnlyFields,false));

DataCard value fields:
If(readOnlyFields=true,View,Edit);

Hi @Share-and-Flow ,
The code you show should work, but as a more reliable alternative, you could drop the Variable and put this on the DisplayMode of the controls

If(
   StatusValue.Selected.Value= "Approved" ||
   StatusValue.Selected.Value= "Rejected",
   DisplayMode.View,
   DisplayMode.Edit
)

 

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.

Thank You @WarrenBelz 

I was going to try your solution, but today my setting started to work again.

This makes it feel so unreliable, I am confused , but its working now.

OK @Share-and-Flow ,

Please let me know - the reliable solutions are sometimes the simplest.

ArtieLeech
Frequent Visitor

We wanted a similar thing as the OP - a Text Input (that we made multi-line) which we wanted to be read-only.

 

Our solution was to change the TextInput's Display mode to Disabled:

 

ArtieLeech_0-1642589682351.png

 

 

 

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 (2,813)