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 / Check if column contai...
Power Apps
Unanswered

Check if column contains value

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have an HTML table and a collection. I attached a photo with how the collection looks. I have another collection, AllDays, just with all the dates in a month. If the respective day has a column with the value O.H i need to write O.H in my HTML table. How can i do that?

 

Capture.PNG
Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at
    @Anonymous
    What does your HTML table look like currently? What do you want it to look like instead?
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney 

    I've attached two photos with what i have and final product.

    Ignore the I and S's. 

    The white spaces represent the weekends.

    "Liber" means its a holiday that day.

    I've got that in my table.

    Now i need to check if someone has an approved holiday that day and write CO or H.O. Doesnt matter

     

    final.PNG
    current.PNG
  • mdevaney Profile Picture
    29,993 Moderator on at
    @Anonymous
    Wow, that’s quite the fancy HTML table 🙂

    I’m not sure how you are currently building it. Maybe some more info would help. Typically you can check the value of LEAVE like this inside of a FORALL loop.

    If(!IsBlank(LEAVE), LEAVE))

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney 

    This is where all the magic happens 

    Concat(Gallery2.AllItems, "<tr> <th rowspan='2'>" & EmployeeName & "</th>" & Concat(ZileLuna, "<td colspan='2'>" & If(Value in WeekDaysCollection, " ",If(IsBlank(LookUp (HolidaysCollection, Text(Value, "[$-en-US]mm/dd") = Text (StartDate, "[$-en-US]mm/dd") )), "8", "Liber" ) ) & "</td>" ) & "</tr> <tr>" & Concat(ZileLuna, "<td>" & If(Value in WeekDaysCollection, " ", If(IsBlank(LookUp(HolidaysCollection, Text(Value, "[$-en-US]mm/dd") = Text (StartDate, "[$-en-US]mm/dd") )), "10" )) &"</td>" &"<td>" & If(Value in WeekDaysCollection, " ", If(IsBlank(LookUp(HolidaysCollection, Text(Value, "[$-en-US]mm/dd") = Text (StartDate, "[$-en-US]mm/dd") )), "18" )) & "</td>" ) & "</tr>"

     

    Gallery2.AllItems retrieves all the employees from an excel collection.

    ZileLuna is a collection with every day in the current month. 

    WeekDaysCollection is a collection with all the weekends dates in the current month.

    HolidaysCollection is a collection with all the holidays dates.

     

    To build the collection with all the dates when someone is on leave im doing it like this

    ClearCollect(ZileConcediiInLuna,AddColumns(RenameColumns(ZileLuna,"Value","SearchDate"),"LEAVE",If(!IsBlank(LookUp(Table4,Text(SearchDate,"[$-en-US]mm/dd/yyyy") = Text(Date,"[$-en-US]mm/dd/yyyy"))),"O.H")))

    To build the weekends and the holidays i do it with If(Value in Collection, "message") but because the collection with approved leave requests stores all the dates, if i do that, will fill every day with O.H.  

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Wow, that is looking pretty "magical" (ie complicated) O_o LOL.  Not sure if I'll know what to do here...

     

    In the final example you gave O.H. did not appear.  I assume this final table is based on the HTML code.  Where should O.H. appear?  Please show in a picture.

     

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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     The final table is just a pdf for me to understand what i need to do and how we do things so i can automate it.

    CO and H.O are the same thing.

    I set up some testing data in my collection(there is a photo with how the collection looks like in the first post) and O.H appears on 2/4/2020 so in my table on 4th cell. 

    dateOH.PNG
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    This one is out of my league, sorry.  There's just too much complexity going on here with the CONCAT + HTML code for me to understand it.  Hopefully someone else is able to jump in here 😞

     

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

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

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard