Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Make some Text Input fields read-only in Edit Forms

(0) ShareShare
ReportReport
Posted on by 38

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.

  • ArtieLeech Profile Picture
    ArtieLeech 42 on at
    Re: Make some Text Input fields read-only in Edit Forms

    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

     

     

     

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Make some Text Input fields read-only in Edit Forms

    OK @Share-and-Flow ,

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

  • Share-and-Flow Profile Picture
    Share-and-Flow 32 on at
    Re: Make some Text Input fields read-only in Edit Forms

    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.

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Make some Text Input fields read-only in Edit Forms

    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.

  • Share-and-Flow Profile Picture
    Share-and-Flow 32 on at
    Re: Make some Text Input fields read-only in Edit Forms

    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);

  • Flowbginner Profile Picture
    Flowbginner 38 on at
    Re: Make some Text Input fields read-only in Edit Forms

    @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?

  • Flowbginner Profile Picture
    Flowbginner 38 on at
    Re: Make some Text Input fields read-only in Edit Forms

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

  • Verified answer
    mdevaney Profile Picture
    mdevaney 29,987 on at
    Re: Make some Text Input fields read-only in Edit Forms

    @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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard