cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ogh_sabyasachi
Helper III
Helper III

How to get distinct values in a html text?

Hi community,

 

I have an html text where I am filtering a collection and getting the list as in the attached screenshot.  Is there any way we can get the distinct values here.  For eg:  we want "HIPAA Rules & Regulations" just appear once.

1 ACCEPTED SOLUTION

Accepted Solutions

You can use the Distinct function to retrieve only the unique values for the FullNameOfCourse column in your filtered expression:

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" & "<tr style='background-color:#efefef' >
<td> Course Name </td>
</tr>" &
Concat(
    Sort(
        Distinct(
            Filter(MyTempCol2, Full_Name in ([@PowerBIIntegration]).Data.Full_Name),
            FullNameOfCourse),
        Result),
    "<tr><td>" & Result & "</td></tr>"
) & "
</table>"

 Hope this helps!

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@ogh_sabyasachi 
I think I know how to help you but I do not want to retype all of the code in your picture.  Please copy and paste your code as text into the forums and I'll make my suggestions.

 

---
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 @mdevaney ,

 

This is the html code I am using.  Hope this is helpful.  Please suggest the solution.  Thanks.

 

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" & "<tr style='background-color:#efefef' >
<td> Course Name </td>
</tr>
" & Concat(Sort(Filter(MyTempCol2, Full_Name in ([@PowerBIIntegration]).Data.Full_Name),FullNameOfCourse),

"<tr><td>" & FullNameOfCourse & " </td></tr>"
) & "
</table>"

You can use the Distinct function to retrieve only the unique values for the FullNameOfCourse column in your filtered expression:

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" & "<tr style='background-color:#efefef' >
<td> Course Name </td>
</tr>" &
Concat(
    Sort(
        Distinct(
            Filter(MyTempCol2, Full_Name in ([@PowerBIIntegration]).Data.Full_Name),
            FullNameOfCourse),
        Result),
    "<tr><td>" & Result & "</td></tr>"
) & "
</table>"

 Hope this helps!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,089)