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 / Need to match labels t...
Power Apps
Answered

Need to match labels to set Toggle

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am playing around in a test app so I dont have to mess up my main app.

 

Onvisible of the screen I have the following setting a variable.

 

Set(var_engineer,LookUp(Engineers, UPN = User().Email))

We set the variable to the record in the SPO List that matches the current user.

 

Label1, I am pulling the assignmenthours for the engineer.

Concat(var_engineer.AssignmentHours.Value,Value,",")

 

Label2 is just getting the current hour.

Hour(Now())

 

I am having trouble with an IF statement and contains

 

I want an if statement that checks if the number in Label2 matches one of the numbers in Label1.

if so, the toggle is on.  If not, it is off.

 

lardo5150_0-1643040446832.png

 

Categories:
I have the same question (0)
  • Verified answer
    Abhilash_Swain Profile Picture
    901 on at

    Hi @lardo5150 ,

    you can achieve it many ways. share one of them.

     

    Abhilash_Swain_0-1643041300328.png

    like and accept as the solution if this will help.

  • lardo5150 Profile Picture
    Microsoft Employee on at

    why are you using the >0 at the end?

  • lardo5150 Profile Picture
    Microsoft Employee on at

    Also, with FIND vs Match/Contain....

     

    If I have the number 12, and the label has 11 in it, with it match that cause of the "1", or will it only match "12"?

    I would need it to match the numbers exactly.

    so in that example of 12 and 11, they wont match.  only 12 will match with 12.

  • Abhilash_Swain Profile Picture
    901 on at

    Hi @lardo5150 ,
    Apology !!!

     

    Please use the below logic.

    Abhilash_Swain_0-1643051100852.pngAbhilash_Swain_1-1643051123835.png

     

     

    Use a Text Box to search your value. On this TextBox , write below code

    Property- OnChange-ForAll(Split(Label1,","),Collect(colltest,{Hour:ThisRecord}))
    Explain- When ever teh value changes in this text box, it will create a collection by using split.
    Here it creates a collection colltest, having column Hour

    On the Toggle control Default, we will filter the collection based on the textbox value and count no of rows.
    If there is an exact match, then there will be at least 1 row and the condition turns true.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard