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

Announcements

News and Announcements icon
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,793 Super User 2026 Season 1 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 510

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 281

Last 30 days Overall leaderboard