cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdhamFH
Helper V
Helper V

Condition label in power apps

Hello, 

 

i have two columns in my excel and it look like this

test.PNG

 

 

and then in power apps i want to make a condition if record in column date is equal to todays date and record in column start is equal to my label(the picture below is 1:00 PM and 2:00 PM) then i want to set my another label's text to "booked"

test1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

How should it be ? need some advice 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

i got my solution and here is my expression 

LookUp(Table2,Ruangan = Dropdown1.Selected.Ruangan And Text(Date1,"[$-en-US]yyyyddmm") = Text(Today(),"[$-en-US]yyyymmdd") And Text(DateAdd(Start,TimeZoneOffset(Start),Minutes),DateTimeFormat.ShortTime) = Label1.Text,"booked")

thank you @VijayTailor @WarrenBelz 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User III
Super User III

Hi @AdhamFH ,

Firstly, Date is not a good name for a field as it is a Reserved Word in Power Apps. This aside, the syntax you need on the Text of the label is something like

If(
   IsToday(ThisItem.Date) &&
   YourDropDownName.Selected.Value = ThisItem.Start,
   "Booked"
)

 

Please click Accept as solution 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 giving it Thumbs Up.

 

VijayTailor
Resident Rockstar
Resident Rockstar

Hi @AdhamFH ,

You can use like below Code on Gallery Label.

If(DateValue(Text(ThisItem.DateBooking,"[$-en-US]dd/mm/yyyy"))=Today() && Text(Body1.Text) = Text(Title2.Text),"Booked","Not Booked")



VijayTailor_0-1601551731902.png

Thanks,
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."

Hi @VijayTailor and @WarrenBelz thank you for your reply, i will try this solution

i got my solution and here is my expression 

LookUp(Table2,Ruangan = Dropdown1.Selected.Ruangan And Text(Date1,"[$-en-US]yyyyddmm") = Text(Today(),"[$-en-US]yyyymmdd") And Text(DateAdd(Start,TimeZoneOffset(Start),Minutes),DateTimeFormat.ShortTime) = Label1.Text,"booked")

thank you @VijayTailor @WarrenBelz 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,301)