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

Create HTML from collection

Hello everybody,

is it possible to create multiple and individual HTML documents from data that is inside a collection? We are gathering our data in a collection and by pressing a button the data will be send to our SharePoint online datasource.

I‘ve tried to use the ForAll Function but without success.

Best regards.
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Create HTML from collection

In this case, you can create the HTML based on the data from your forms as you are collecting them into the 'colMyItems' collection. For example, expanding on your example, you could use something like below:

Collect(
    colMyItems;
    AddColumns(
        Table({
            itemA: TextInput1.Text;
            itemB: TextInput1_1.Text;
            itemC: TextInput1_2.Text
        });
        "myHtml";
        "<table border='1'>" &
            "<tr><th colspan='2'>" & itemA & "</th></tr>" & 
            "<tr><td>" & itemB & "</td><td>" & itemC & "</td></tr></table>"))

The attached app shows this expression being used. To open it, save it locally, then go to https://create.powerapps.com, then choose Open, Browse and find the file you previously saved.

Hope this helps!

View solution in original post

4 REPLIES 4
Highlighted
Power Apps
Power Apps

Re: Create HTML from collection

There are a few ways how you can compose HTML from data in a collection; can you give some example of the data that you have, and what you want the output to be?

For example, if you have a collection like this one:

ForumPost001.png

You could convert it to HTML using the Concat function like in the example below:

"<table>" &
Concat(
    Countries,
    "<tr><td rowspan=""2""><img src=""" & Flag & """ width=""80"" height=""60""></td>" &
        "<td><b>" & Country & "</b></td></tr>" &
        "<tr><td>" & Population & "</td></tr>") &
"</table>"

Hope this helps!

Highlighted
Resolver I
Resolver I

Re: Create HTML from collection

Hi @CarlosFigueira,

thanks I really appreciate your support.

 

I have got a form (myForm) to fill in and a collection named 'colMyItems' which collects the form data (the process repeats when I press a button to locally save the form data to 'colMyItems'). So 'colMyItems' contains the data from multiple completed forms (myForm).

 

For example:

Collect(colMyItems; {itemA: valueA; itemB: valueB; itemC: valueC})

 

Now I want to create single HTML files for each form (which are saved in 'colMyItems').

 

Best regards and thanks in advance!

 

 

Highlighted
Power Apps
Power Apps

Re: Create HTML from collection

In this case, you can create the HTML based on the data from your forms as you are collecting them into the 'colMyItems' collection. For example, expanding on your example, you could use something like below:

Collect(
    colMyItems;
    AddColumns(
        Table({
            itemA: TextInput1.Text;
            itemB: TextInput1_1.Text;
            itemC: TextInput1_2.Text
        });
        "myHtml";
        "<table border='1'>" &
            "<tr><th colspan='2'>" & itemA & "</th></tr>" & 
            "<tr><td>" & itemB & "</td><td>" & itemC & "</td></tr></table>"))

The attached app shows this expression being used. To open it, save it locally, then go to https://create.powerapps.com, then choose Open, Browse and find the file you previously saved.

Hope this helps!

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Create HTML from collection

Hi @CarlosFigueira,

 

this works like a charm!

 

Thank you so much.

 

Best regards.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,018)