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 / Label visible property...
Power Apps
Suggested Answer

Label visible property takes time to execute.

(1) ShareShare
ReportReport
Posted on by 126
I have below piece of code which takes time to execute. This code is in label visible property, but it takes time to execute. The label displays the message "You don't have access". This message appears when the screen is visible and disappears when the below code executes. The expectation is the message shouldn't appear even for a second. 
 
May i know how to achieve this?
 
Label Visible
If(
    ((LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "Submitted" || LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "I Rejected" || LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "C Rejected" || LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "Rejected by Manager") && Lower(User().Email) = Lower(
        LookUp(
            'Data Source',
            ID = If(
                !IsBlank(Param("ID")),
                Value(Param("ID")),
                varedititem.ID
            ),
            Delegate.Email
        )
    )) || (LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "Updated" && Lower(User().Email) = Lower(
        LookUp(
            'Data Source',
            ID = If(
                !IsBlank(Param("ID")),
                Value(Param("ID")),
                varedititem.ID
            ),
            HiringManager.Email
        )
    )) || (((LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "Submitted" || LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "I Rejected" || LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "C Rejected") && Lower(User().Email) = Lower(
        LookUp(
            'Data Source',
            ID = If(
                !IsBlank(Param("ID")),
                Value(Param("ID")),
                varedititem.ID
            ),
            HiringManager.Email
        )
    )) && LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        Delegate.Email
    ) = Blank()) || ((var_Cteam || var_Iteam) && LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        FinalCRequired
    ) = true) || LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "Draft" || LookUp(
        'Data Source',
        ID = If(
            !IsBlank(Param("ID")),
            Value(Param("ID")),
            varedititem.ID
        ),
        'Status'
    ) = "Completed",
    false,
    true
)
 
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    2,882 on at
    The main issue is that your Visible property contains many repeated LookUp() calls against the same record. Every time the screen loads, Power Apps must execute all those lookups before it can determine whether the label should be shown.
     
    Instead of putting complex business logic in the Visible property, calculate it once.

    Screen OnVisible
    Set(
        varCurrentRecord,
        LookUp(
            'Data Source',
            ID = Coalesce(
                Value(Param("ID")),
                varedititem.ID
            )
        )
    );
    Set(
        varShowNoAccess,
        !(
            (
                varCurrentRecord.Status in
                ["Submitted","I Rejected","C Rejected","Rejected by Manager"]
                &&
                Lower(User().Email)=Lower(varCurrentRecord.Delegate.Email)
            )
            ||
            (
                varCurrentRecord.Status="Updated"
                &&
                Lower(User().Email)=Lower(varCurrentRecord.HiringManager.Email)
            )
            ||
            (
                varCurrentRecord.Status in
                ["Submitted","I Rejected","C Rejected"]
                &&
                Lower(User().Email)=Lower(varCurrentRecord.HiringManager.Email)
                &&
                IsBlank(varCurrentRecord.Delegate.Email)
            )
            ||
            (
                (var_Cteam || var_Iteam)
                &&
                varCurrentRecord.FinalCRequired
            )
            ||
            (
                varCurrentRecord.Status in
                ["Draft","Completed"]
            )
        )
    );
     
  • MS.Ragavendar Profile Picture
    7,305 Super User 2026 Season 1 on at
     
    You have written around 10+ LookUp() calls, each one hits the data source separately & is executed during UI rendering.
    • Screen loads → Label defaults to true → "You don't have access" shows then all LookUps execute → result computed → label hides
    This causes waiting time which leads to flickering.
     
    Set(varLoadingScreen, true);
     
    Set(
        varResolvedID,
        Coalesce(Value(Param("ID")), varedititem.ID)
    );
     
    Set(
        varCurrentItem,
        LookUp('Data Source', ID = varResolvedID)
    );
     
    With(
        {
            _status: Lower(Coalesce(varCurrentItem.Status.Value, varCurrentItem.Status, "")),
            _delegate: Lower(Coalesce(varCurrentItem.Delegate.Email, "")),
            _hm: Lower(Coalesce(varCurrentItem.HiringManager.Email, "")),
            _me: Lower(User().Email),
            _finalC: Coalesce(varCurrentItem.FinalCRequired, false)
        },
        Set(
            varHasAccess,
            (
                _status in ["submitted", "i rejected", "c rejected", "rejected by manager"] &&
                _me = _delegate
            ) ||
            (
                _status = "updated" &&
                _me = _hm
            ) ||
            (
                _status in ["submitted", "i rejected", "c rejected"] &&
                _me = _hm &&
                IsBlank(_delegate)
            ) ||
            (
                (var_Cteam || var_Iteam) &&
                _finalC
            ) ||
            (
                _status in ["draft", "completed"]
            )
        )
    );
     
    Set(varShowNoAccess, !varHasAccess);
    Set(varLoadingScreen, false);
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
  • Suggested answer
    Valantis Profile Picture
    6,341 on at
     
    The root cause is that each LookUp in the Visible property fires a separate network call to the data source at render time, so the label shows briefly before all lookups complete.
     
    The fix: do one single LookUp on Screen OnVisible, store the record in a variable, then use that variable everywhere.
     
    Screen OnVisible:
    Set(varCurrentRecord, LookUp('Data Source', ID = Coalesce(Value(Param("ID")), varedititem.ID)))
    Label Visible then becomes:
    If(varCurrentRecord.Status = "Draft" || ..., false, true)
     
    The label evaluates instantly from the variable with no network calls, so no flicker.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • Suggested answer
    WarrenBelz Profile Picture
    155,660 Most Valuable Professional on at
    I will add some suggestions here that may assist
    • Use a With() Statement to define the record required
    • Chain the ID logic seperately as a conditional statement inside a Filter may not be Delegable.
    • You do not have to use true/false - just make a statement that is either true or false - in this case I have also used Not as your first argument is false
    • The same goes for referring to a Boolean field value (FinalCRequired)
    • You can group possible outcomes with an in statement and refer to a Table of values
    I am not sure on your bracketing logic (you also have duplicated a couple of values in the Status, so you may have to fine-tune the below, but I am sure you will get the idea.
    With(
       {
          _ID: 
          Coalesce(
             Value(Param("ID")),
             varedititem.ID
          )
       },
       With(
          {
             _Record:
             LookUp(
                'Data Source',
                ID = _ID
             )
          },
          Not(
             (
                _Record.'Status' in ["Submitted", "I Rejected", "C Rejected"] ||
                (
                   _Record.Status = "Rejected by Manager" && 
                   Lower(User().Email) = Lower(_Record.Delegate.Email)
                )
             ) || 
             (
                _Record.'Status' = "Updated" && 
                Lower(User().Email) = Lower(_Record.HiringManager.Email)
             ) || 
             (
                _Record.Status = "Submitted" || 
                _Record.'Status' = "I Rejected" || 
                (
                   _Record.'Status' = "C Rejected" && 
                   Lower(User().Email) = Lower(_Record.HiringManager.Email) && 
                   _Record.Delegate.Email = Blank()
                )
             ) || 
             (
                (var_Cteam || var_Iteam) && 
                _Record.FinalCRequired
             ) || 
             _Record.'Status' in ["Draft", "Completed"]
          )
       )
    )
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
     
  • WarrenBelz Profile Picture
    155,660 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   
  • Suggested answer
    MS.Ragavendar Profile Picture
    7,305 Super User 2026 Season 1 on at
     
    A quick follow-up to see, does the suggestion worked for you or still you were looking for any other approaches or assistance.
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard