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 / Display Mode with If S...
Power Apps
Answered

Display Mode with If Statement

(0) ShareShare
ReportReport
Posted on by 55

Hello,

I have a text input that I want to be editable in some conditions and only viewable under other conditions, based on a value in a Sharepoint list. The display mode for the text input is set to:

If(var[redacted].OpenOrClosed="Closed",DisplayMode.View,DisplayMode.Edit)

When I go into the app, the app is still allowing me to edit even when the item is considered "closed" in sharepoint. I want to just have a box to have any inputted text (from when it is not considered "closed") displayed, but I do not want to be able to edit.

 

Any ideas?

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

    Hi @dsopshin,

    Could you please tell me that how you fire this variable?

     

    Generally, the issue you encountered is that Power Apps could not capture the OpenOrClosed of a special record when you go into the app, so you need to validate the OpenOrClosed of this special record.

     

     

  • dsopshin Profile Picture
    55 on at

    @v-qiaqi-msft 

    Thanks for the response! The variable is triggered using OnStart - it comes from the ID being included in a flow to a URL (from a PowerAutomate email). 

    This is what's in OnStart:

    If(
     !IsBlank(Param("ID")),
     Set(
     varItem,
     LookUp(
     '[sharepoint]',
     Title = Value(Param("ID"))
     )
     )
    );

     Everything else that uses this variable works correctly (pulling the correct data into the app using the ID).

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

    Hi @dsopshin,

    Try to set the LookUp() formula to the DisplayMode property as below:

    If(
     !IsBlank(Param("ID")),
     LookUp(
     '[sharepoint]',
     Title = Value(Param("ID"))
     ).OpenOrClosed="Closed",
     DisplayMode.View,DisplayMode.Edit
    );
  • dsopshin Profile Picture
    55 on at

    @v-qiaqi-msft 

    Thanks for the quick response! Unfortunately that is giving me an error. 

    The ; at the end errors to "Expected Operator. We expect an operator..." 

    If I remove the ; ,the entire thing gets an error. 

     

    It looks like (within the If Statement) the LookUp is a True Value, the DisplayMode.View is a Logical Test, and DisplayMode.Edit is another True Value. I tried adding an If(And( to keep everything as part of the logical test, but I got another error there. 

     

    Any other ideas? Thanks!

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

    Hi @dsopshin,

    Each region has different operators, so you need to post your formula and the error message.😃

     

    My mistake that the formula has something wrong, please modify as below:

    If(
     !IsBlank(Param("ID"))&&
     LookUp(
     '[sharepoint]',
     Title = Value(Param("ID"))
     ).OpenOrClosed="Closed",
     DisplayMode.View,DisplayMode.Edit
    )

     

    If there is still something wrror, do remember to show me your formula and the specific error message.

    Keep in touch.

  • dsopshin Profile Picture
    55 on at

    This worked perfectly! Thank you so much for all of the assistance!

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard