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 / Editable datacard whi...
Power Apps
Answered

Editable datacard whit formmode = view

(0) ShareShare
ReportReport
Posted on by 83

Hello Everyone,

In an application I developed, I have a variable called "VarFormMode." It opens in "edit" mode when I want to edit the selected data in the gallery, and in "view" mode when I just want to view it. However, even if I open only one data card in "view" mode, I still want to be able to edit it. Can you help me with this issue?

Here is the relevant information from my app:

  • varFormMode: A variable I use to control the form mode (either "edit" or "view").
  • DataCardValue17: This is the data card I want to edit, even when the form is opened with varDataCardMode = "view".
 
Thanks a lot.
Categories:
  • Suggested answer
    CU18061035-1 Profile Picture
    Microsoft Employee on at
    hey
     
     
    you can try this in the formmode of the form:
    If(varFormMode = "edit", FormMode.Edit, FormMode.View)
    
    and in the Displaymode of the Datacard:
    DisplayMode: FormMode.Edit
     
     
     
    if my answer helped please mark as verified,
     
     
    cheers
  • GokhanA. Profile Picture
    83 on at
    Hi @mmbr1606
     
    I actually tried the method you suggested before opening the topic here, but I still couldn’t get any results.
    To provide a bit more information, even when "formMode" is set to "view," and I modify the "displayMode" property of "DataCardValue17" to "DisplayMode.Edit," it still doesn’t become editable.
    I think we need to try another approach.
  • CU18061035-1 Profile Picture
    Microsoft Employee on at
    hey
     
     
    thanks for trying.
     
    this was basically the only thing where i thought it could work. What could also work is to set every datacard one by one to view and only keep the one you need to view.
     
     you could have a button that says view entries (or so) and set a variable to true or view or whatever.

    in every datacard you set the displaymode you want to dependent on the variable
     
    cheers
  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at
    Hi  GokhanA
     
    Can you confirm that DataCardValue17 is actually the name of the data card?
     
    The standard naming convention names the edit control DataCardValue17, and the data card ColumnName_DataCard17.
     
    If that's the case, if you try setting the display mode of the parent data card as well as the data control (DataCardValue17), does that make a difference? 
  • GokhanA. Profile Picture
    83 on at
    Hi Timl,
     
    Yes, DataCardValue17 is the name of the card in the app. I didn’t assign a custom name to this card. Along with DataCardValue17, I have a total of around 40 cards. I control these cards using a variable with the **formMode** property. As you suggested, I tried modifying only the **displayMode** property of DataCardValue17 to "DisplayMode.Edit," but since the **formMode** I control with the variable is set to "View," DataCardValue17 does not become editable.  
     
    thanks for your response.
  • CU18061035-1 Profile Picture
    Microsoft Employee on at
    have you tried my suggestion on putting the displaymode property depending on the variable datavard, by datacard and only set the number 17 to edit and all others to view?
     
     
    cheers
  • Verified answer
    GokhanA. Profile Picture
    83 on at
    Hello Everyone,
     
     
     
    I solved my problem with the following code. it's a little bit long and not a clean code but it's work
     
    My goal here is to adjust the visibility of the save button.
     
     
     
    thanks for all your response. 
     
     
    Switch(
        true,
        And(
            varProfileType = "local",
            DataCardValue20.Value = true,
            DataCardValue21.Value = true,
            DataCardValue19.Value = true,
            DataCardValue22.Value = true,
            DataCardValue18.Value = true,
            DataCardValue23.Value = true
        ), DisplayMode.Edit,
        And(
            varProfileType = "foreign",
            DataCardValue20.Value = false,
            DataCardValue21.Value = false,
            DataCardValue19.Value = true,
            DataCardValue22.Value = true,
            DataCardValue18.Value = true,
            DataCardValue23.Value = true
        ), DisplayMode.Edit,
        And(
            varProfileType = "BusinessPartner",
            DataCardValue20.Value = true,
            DataCardValue21.Value = true,
            DataCardValue19.Value = true,
            DataCardValue22.Value = true,
            DataCardValue18.Value = true,
            DataCardValue23.Value = true
        ), DisplayMode.Edit,
        And(
            varProfileType = "Transporter",
            DataCardValue20.Value = false,
            DataCardValue21.Value = false,
            DataCardValue19.Value = false,
            DataCardValue22.Value = true,
            DataCardValue18.Value = false,
            DataCardValue23.Value = true
        ), DisplayMode.Edit,DisplayMode.Disabled
    )
    
    
     
     
     
     
     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard