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 form view depen...
Power Apps
Unanswered

change form view depending a field value

(0) ShareShare
ReportReport
Posted on by 12

Hi!

Depending on the value of a field, I need the form to be displayed in view mode, otherwise in edit mode.
I have the following statement in the OnEdit property of the SharepointIntegration but it only works for me when I double click the edit option of the sharepoint for the selected element.

dalgi24_0-1669165209063.png

 

Someone can help me!

Regards

Categories:
  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @dalgi24 

     

    Don't put your code there.

    On your SharePointForm1's DisplayMode Property you can set it to like

    If(DataCardValue_Estado.Selected.Value="Cerrado"; DisplayMode.View; DisplayMode.Edit)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @dalgi24,

    You should modify your formula as below:

    If(SharePointIntegration.Selected.Status.Value="Red",ViewForm(SharePointForm1),EditForm(SharePointForm1))

    In addition, @cha_cha , nerither SharePointForm1 nor SharepointIntegration has DisplayMode property.

  • cha_cha Profile Picture
    4,932 Moderator on at

    Hi @v-qiaqi-msft 

     

    Thank you for correcting it. @dalgi24  please use @v-qiaqi-msft's code.

  • dalgi24 Profile Picture
    12 on at

    Thanks @v-qiaqi-msft ,

     

    I made the adjustment but the behavior is the same, if it is in a closed state and I click on Edit it is displayed in edition mode, when clicking again it is displayed in view mode.

    ¿Am I doing something wrong? I need the first click to display in the corresponding mode

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @dalgi24,

    Show me you formula.

     

    I have tested on my side, and I edit the record as below:

    vqiaqimsft_0-1669258762471.png

     

  • dalgi24 Profile Picture
    12 on at

    Hi @v-qiaqi-msft ,

     

    This is the formula:

    dalgi24_0-1669296014916.png

    Yes, it is edited as you indicate. When running it looks like this

    dalgi24_1-1669296463624.png

    It should be in view mode as the status (estado) indicates closed (cerrado).

     

    Best Regards!

     

     

     

     

     

     

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard