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

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 III
Super User III

@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

7 REPLIES 7
mdevaney
Super User III
Super User III

@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

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.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,204)