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

How to filter a collection to get a table in html text?

Hello everyone,

 

I am trying to get a table filtered from a collection (that has been pulled from a sharepoint list).  I am trying to filter this one entity from ([@PowerBIIntegration].Data). 

 

Note:  This app is to be used in a powerBI dashboard to send mails based on selection of members and their related data.

 

This is working for a table that has been pulled from a local excel file table (Table5) as in attached screenshot (ExcelTable), but this is not working for the collection (Mycol1) as in attached screenshot (CollectionTable) as suggested in this link.

 

Note:  The filter is showing delegation error when I am trying to use the sharepoint list as a table.

 

Please help!!

 

Do we have any other option to filter this entity from ([@PowerBIIntegration].Data) from a sharepoint list to get the desired table  in html text?

6 REPLIES 6
ZabiBabar
Continued Contributor
Continued Contributor

Hi @ogh_sabyasachi , This is a known limitation with the "in" operator. This post addressed this issue and you would have to use forAll in your case. I

https://powerusers.microsoft.com/t5/Building-Power-Apps/Issue-with-quot-in-quot-operator-inside-quot...

 

Best,
Zabi
Mark this post as a solution, or kudo it if you found it be helpful. You can choose more than multiple answers as solutions, including your own answer. 🙂

I not able to make this work. Can you suggest the required change in the html text please?

 

"</table>" & "<br><br>" & "<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(Filter(Table5,Full_Name in [@PowerBIIntegration].Data.Full_Name),

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

 

 

" Here, table5 is imported from a local excel file. I want this to be a sharepoint list.

Anonymous
Not applicable

@ogh_sabyasachi are you looking to filter the collection based on a drop down or combo box selected value and then get that data in a collection?
or do you want the collection data to converted into html?

 

I want to filter the collection with an entity from PowerBIIntegration data and show the the filtered table in the html.

 

Suppose, we have a table in the collection as follows:

 

IDNameCourseName
1xab
2ycd
1xfg

 

I want the table for name "x" in the HTML as follws:

 

ab
fg

 

the name "x" is coming here from the powerBIIntegration data.

@ogh_sabyasachi , you will have to do something like this, but this code will go on some button that has onSelect property. Maybe the button that sends the email. It can go before the SendEmail function.

Clear(JoinedTable);
ForAll(
  MyColl,
  Collect(
    JoinedTable,
    Filter([@PowerBIIntegration].Data, Full_Name = Name1)
  )
)

 

And then in your html text you can do this:

Concat(JoinedTable, "<tr><td>"  & CourseName & "</td></tr>" & "</table>" ... )

 

You can repeat the same process for both cases. And you should not see the delegation warning. 

 

Best,
Zabi
Mark this post as a solution, or kudo it if you found it be helpful. You can choose more than multiple answers as solutions, including your own answer. 🙂

I am really new to powerApps.   Can you please elaborate a little on what tables are these Mycoll and JoinedTable.  Secondly, my EmailSend button has this formula:  Office365Outlook.SendEmail(TextInputBoxManagerEmailAddress.Text, TextInputBoxEmailSubject.Text, HtmlText1Manager.HtmlText, {IsHtml: true}).  Can you please suggest how to include the above formula here?

 

@ZabiBabar 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,209)