Hey there, I'm developing a system that creates html data based on list or excel database data.
I was thinking about doing something like this when you press the submit button but its not quite working.
ClearCollect(email_Instance_Collect,"");
ForEatch(databace.Title,LookUp(databace,'databace item'),Collect(email_Instance_Collect,{HTML_Instance_Segment:'html inst seg'.HtmlText,html_Item:'databace item',html_Data:'databace_data'}))
Here is what the 'html inst seg'.HTMLText Instance Segment looks like
<!-- Table Information -->
<tr>
<td>
<p>"& 'databce item'.HTMLText &"</p>
</td>
<td>
<p> " & 'databace_data'.HTMLText & "</p>
</td>
</tr>
Here is an example of what I would like the PowerApps code to generate based on the list or excel data.
"
<!-- Data Table -->
<table>
<!-- Table Title -->
<tr>
<th>Data Table Example</th>
</tr>
<!-- Table Information -->
<tr>
<td>
<p>Item One:</p>
</td>
<td>
<p>Item One Data</p>
</td>
</tr>
<!-- Table Information -->
<tr>
<td>
<p>Item Two:</p>
</td>
<td>
<p>Item Two Data</p>
</td>
</tr>
<!-- Table Information -->
<tr>
<td>
<p>Item Three:</p>
</td>
<td>
<p>Item Three Data</p>
</td>
</tr>
</table>
"
This is what the HTML generates.
Data Table Example
Item One: | Item One Data |
Item Two: | Item Two Data |
Item Three: | Item Three Data |
Solved! Go to Solution.
Hi @natmaxex :
Do you want to display the data in the data source in the form of a table in the HTML text control?
I'v made a test for your reference:
1\My data source:
ClearCollect(
databace,
{
html_Item: "Item One:",
html_Data: "Item One Data"
},
{
html_Item: "Item Two:",
html_Data: "Item Two Data"
},
{
html_Item: "Item Three:",
html_Data: "Item Three Data"
}
)
2\Add a button and set it's OnSelect property to:
UpdateContext({email_Instance:"
<!-- Data Table -->
<table>
<!-- Table Title -->
<tr>
<th>Data Table Example</th>
</tr>"&Concat(ForAll(databace,"<!-- Table Information -->
<tr>
<td>
<p>"&html_Item&"</p>
</td>
<td>
<p>"&html_Data&"</p>
</td>
</tr>"),Value)&"</table>"})
3\add a html text control and set it's HtmlText property to:
email_Instance
Best Regards,
Bof
Hi @natmaxex ,
Try this:
UpdateContext({email_Instance_Collect:"<table><tr><th>Data Table Example</th></tr>");
ForEatch(databace.Title,LookUp(databace,'databace item'),
UpdateContext({email_Instance_Collect:Concatenate(email_Instance_Collect,'html inst seg'.HtmlText,'databace item',html_Data:'databace_data'))});
UpdateContext({email_Instance_Collect:Concatenate(email_Instance_Collect,"</table">)});
I am adding them to a local variable than to a collection.
Now you set this local variable to a richtext control in powerApps.
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Proud to be a Super User!
Regards,Hi @natmaxex :
Do you want to display the data in the data source in the form of a table in the HTML text control?
I'v made a test for your reference:
1\My data source:
ClearCollect(
databace,
{
html_Item: "Item One:",
html_Data: "Item One Data"
},
{
html_Item: "Item Two:",
html_Data: "Item Two Data"
},
{
html_Item: "Item Three:",
html_Data: "Item Three Data"
}
)
2\Add a button and set it's OnSelect property to:
UpdateContext({email_Instance:"
<!-- Data Table -->
<table>
<!-- Table Title -->
<tr>
<th>Data Table Example</th>
</tr>"&Concat(ForAll(databace,"<!-- Table Information -->
<tr>
<td>
<p>"&html_Item&"</p>
</td>
<td>
<p>"&html_Data&"</p>
</td>
</tr>"),Value)&"</table>"})
3\add a html text control and set it's HtmlText property to:
email_Instance
Best Regards,
Bof
User | Count |
---|---|
183 | |
105 | |
89 | |
45 | |
43 |
User | Count |
---|---|
229 | |
105 | |
105 | |
67 | |
66 |