cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver I
Resolver I

Instantiate HTML Data

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

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

 

1.JPG

Best Regards,

Bof

 

View solution in original post

2 REPLIES 2
Super User III
Super User III

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.




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.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Community Support
Community Support

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

 

1.JPG

Best Regards,

Bof

 

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (99,634)