web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Change a data card to ...
Power Apps
Answered

Change a data card to read only when in Edit mode

(1) ShareShare
ReportReport
Posted on by 22
I am essentially asking a very similar question to what has been asked before "I am using PowerApps to create a SharePoint Form. I want to have a data card for "Date" that the user can change when they are submitting a new form, but if they click edit in the app, it becomes read only and they cannot change it anymore. Is this possible?"
 
However, the solution that was given a few years back gets flagged with an invalid argument error:
DisplayMode = "If(SharePointForm1.Mode = FormMode.New, DisplayMode.Edit.View)"
 
I then found and tried this, and while it doesn't get flagged with an error, it does not seem to be actually making any effect on the function of my form:
DisplayMode = "If(SharePointForm1.Mode = FormMode.New, DisplayMode.Edit, DisplayMode.View)"
 
Then, I found this answer in these forums, and it sort of works to lock the field when the form is in edit mode, but this includes having the DefaultDate set to "today."
DisplayMode = If(SharePointForm1.Mode=FormMode.New,DisplayMode.Edit,DisplayMode.View)
In short, when the form is edited, it shows todays date, rather than keeping/locking in the date that was entered when the form was first submitted, like I want.
 
Any suggestions would be much appreciated. I am at a loss as how to further troubleshoot this,
Karissa
Categories:
I have the same question (0)
  • Verified answer
    Nandit Profile Picture
    1,568 Moderator on at
    Hi  LadieKay,
     
    How about you try to use the third formula you've mentioned:
    DisplayMode = If(SharePointForm1.Mode=FormMode.New,DisplayMode.Edit,DisplayMode.View)
    and update the DefaultDate property to:
    ThisItem.YourDateColumn
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
  • Verified answer
    LadieKay Profile Picture
    22 on at
    HI Nandit,
     
    I really appreciate your quick response! This might work, but I feel like adjustments would have to be made to the DefaultDate property code you suggest. This is because I already have a code in there that tells the form to autofill with "today's" date, so people don't have to enter it when they are filling out the form for the first time. However, I want this initial entry date to stay the same, so how do I keep the convenience for form users, while having it stay stable/uneditable in edit mode?
     
    DefaultDate = If(SharePointForm1.Mode=FormMode.New,DisplayMode.Edit,DisplayMode.
    ThisItem.'Entry Date')
     
    DisplayMode = If(SharePointForm1.Mode=FormMode.New,DisplayMode.Edit,DisplayMode.View)
     
     
    I am a novice at all this, learning this for work, so I am sorry if this seems like it should be obvious. I truly appreciate the hand holding,
    Ladiekay
  • Verified answer
    timl Profile Picture
    36,393 Super User 2025 Season 2 on at
    Hi LadieKay,
     
    These sets of should hopefully accomplish what you want to achieve. 
     
     
    DefaultDate = If(SharePointForm1.Mode=FormMode.New,
                    Today(),
                    ThisItem.'Entry Date'
                  )
     
    DisplayMode = If(SharePointForm1.Mode=FormMode.New,
                    DisplayMode.Edit,
                    DisplayMode.View
                  )
     
     
  • LadieKay Profile Picture
    22 on at
    Thank you so much Nandit!  That definitely did the trick, and I really appreciate your help!
    Ladiekay

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard