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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Label Text with If Con...
Power Apps
Answered

Label Text with If Condition

(0) ShareShare
ReportReport
Posted on by 231

Hi 

I need your assistance with this formula

I have a label text the get the Result from the SharePoint

I want to start the Label with Ready to Work Check Required, then go look at the last record for the employee and get the result from the Result Column

 

I put on the ONTEXT Code this formula, however it is getting the Data for Last Employee checked in. I want to data for my record only how I can do that.

 

lolla70_0-1614620383626.png

 

 

With({_email: User().Email},
If(!LookUp('Back to Work Eligibility', StartsWith(Employee.Email,_email),true),
"Ready to Work Check Required",


With({_records: SortByColumns(Filter('Back to Work Eligibility',StartsWith(Employee.Email,_email)), "NextCheck_x002d_InDate", Descending)},
Text(
With({_utc: First(_records).Result},
If(!IsBlank(Last('Back to Work Eligibility').Result), Last('Back to Work Eligibility').Result)
)
)
)
)
)

Categories:
I have the same question (0)
  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at

    Hi @lolla70 ,

    you can Add the Another Lookup/Filter Condition inside the Last Function.
    like if you want the only record is related to you then Add Filter Condition Like CreateBy = User().Email
    See below your code.

    With({_email: User().Email},
    If(!LookUp('Back to Work Eligibility', StartsWith(Employee.Email,_email),true),
    "Ready to Work Check Required",


    With({_records: SortByColumns(Filter('Back to Work Eligibility',StartsWith(Employee.Email,_email)), "NextCheck_x002d_InDate", Descending)},
    Text(
    With({_utc: First(_records).Result},
    If(!IsBlank(Last('Back to Work Eligibility').Result), Last('Back to Work Eligibility').Result)
    )
    )
    )
    )
    )


    See the Approach for Display the Data Related to you.
    Code - 

    Last(Filter(TSMasterData,'Created By'.Email= User().Email,Title).Title).Title

    VijayTailor_0-1614622368785.png

    Thanks,
    Vijay

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay



  • LA-27081519-0 Profile Picture
    231 on at

    Hi @VijayTailor 

    How do I reset the lblResult when it is the next day to come back to "Ready to Work Check Required"

     

    With({_email: User().Email},
    If(!LookUp('Back to Work Eligibility', StartsWith(Employee.Email,_email),true),
    "Ready to Work Check Required",


    With({_records: SortByColumns(Filter('Back to Work Eligibility',StartsWith(Employee.Email,_email)), "NextCheck_x002d_InDate", Descending)},
    With({_email: First(_records).Result},
    If(!IsBlank(Last(Filter('Back to Work Eligibility', 'Created By'.Email = User().Email, Result).Result).Result), Last(Filter('Back to Work Eligibility', 'Created By'.Email = User().Email, Result).Result).Result)

    )
    )
    )
    )

  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at

    @lolla70
    if the record is created on a Daily basis then add one more condition in the filter like Created = Today().
    then Automatically Label will Updated the Values-Based on data found.

  • LA-27081519-0 Profile Picture
    231 on at

    Thank you so much for replying. When I added the Created = Today() the screen get black and I need to have on in Ready for Work Check Required"!!! Did I added correct?

    lolla70_0-1614717355795.png

     

    With({_email: User().Email},
    If(!LookUp('Back to Work Eligibility', StartsWith(Employee.Email,_email),true),
    "Ready to Work Check Required",


    With({_records: SortByColumns(Filter('Back to Work Eligibility',StartsWith(Employee.Email,_email)), "NextCheck_x002d_InDate", Descending)},
    With({_email: First(_records).Result},
    If(!IsBlank(Last(Filter('Back to Work Eligibility', 'Created By'.Email = User().Email, Created = Today(), Result).Result).Result), Last(Filter('Back to Work Eligibility', 'Created By'.Email = User().Email, Created = Today(), Result).Result).Result)

    )
    )
    )
    )

  • LA-27081519-0 Profile Picture
    231 on at

    Any help to finish my APP would be appreciated.

     

    When I added the Created = Today() the screen get black and I need to have on in Ready for Work Check Required"!!! Did I added correct?

     

     

    With({_email: User().Email},
    If(!LookUp('Back to Work Eligibility', StartsWith(Employee.Email,_email),true),
    "Ready to Work Check Required",


    With({_records: SortByColumns(Filter('Back to Work Eligibility',StartsWith(Employee.Email,_email)), "NextCheck_x002d_InDate", Descending)},
    With({_email: First(_records).Result},
    If(!IsBlank(Last(Filter('Back to Work Eligibility', 'Created By'.Email = User().Email, Created = Today(), Result).Result).Result), Last(Filter('Back to Work Eligibility', 'Created By'.Email = User().Email, Created = Today(), Result).Result).Result)

    )
    )
    )
    )

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard