cancel
Showing results for 
Search instead for 
Did you mean: 

Publish HTML Files or TXT files from Microsoft Teams channel tab Forms via Flow

One of the most common desires for a workflow is the ability to create documentation from a form. There are endless business processes for this kind of workflow, and such a workflow can easily integrate as part of a larger business process.

 

Ideas for modification

 

This Flow could be modified conditionally to have certain responses direct files to be added as attachments to List Items, to be sorted into different document libraries, or even be sent to different users via emails, or have notifications sent to those users all based on the dynamic data generated by form responses. Further notifications, emails, approvals and other workflow options could easily be conditionally added to these steps or as separate workflows based on business needs.

 

The Flow in question

 

With only a few short steps, it is possible to use flow to create txt or html files which can be easily formatted and viewed in SharePoint.

 

The first thing I'm going to do is create my Form in Teams so that people can easily access the point for data entry from a labeled tab. I simply click the "+" at the top of the Teams channel to create a new Tab, and then name and create my Microsoft Form.

Image 36.png

 

 Image 001.png

The form as it exists in Teams.

 

 

 Image 002.png

(the form in its entirety for reference)

Once I have my entry Form, I can go ahead and hop on over to Flow, and create a new Flow from scratch.

 

In order to use the data I'm pulling from the Form, I need to get the response data for my later steps, so this will be the first step I take in setting up the Flow.

 Image 003.png

 

Great! Now I have lots of dynamic data to play with.

 

Next, I'm going to use the Flow option to create a file. When I do this, I'm going to use a combination of HTML and the dynamic Forms fill data to create my document.

 

All I need to do to make the file an HTML file is add the ".html" extension to the end of the file. If I prefer to make this a txt document, I simply can add the ".txt" extension, and type normally in the "file content" section as you would in any text editor.

 

For this, I'm going to make an HTML document; I've created a "Customer Records" Document Library under the team to store this information. This way it can easily be viewed in SharePoint or connected to the Team. As we may be generating tons of records, it may not be best to have them all in the Folder corresponding to the Channel name  for them to appear in the "Files" tab of the Team in question.

 

 

 Image 004.png

 

My HTML is nothing fancy- here's a quick reference for those unfamiliar:

 

<html> be sure and add the </html> at the end of the document.

<div align="center"> = alignment- don't forget to add your </div> at the end of the section.

<h1>HEADER GOES HERE</h1>

<b>BOLD TEXT GOES HERE</b>

<i>INDENTED TEXT GOES HERE</i>

<p>New Paragraph</p>

<br>New Line</br>

<a href="http://URL FOR LINK GOES HERE.com">TEXT FOR LINK GOES HERE</a>

 

Unfortunately, inside of SharePoint, you cannot reference images (boy did I play with that and try to get it to work 1,000 different ways!). You could still add it so that people will see the image if they download and view the HTML document in a browser.

 

The HTML for this is <img src="IMAGE URL">

 

 Image 005.png

Ok, so now I've built in my HTML, and added my Dynamic Content where appropriate. Be sure to add some dynamic content in the name to keep the record names unique (I usually add the date of submission for this).

 

Now you're ready to allow your users to create HTML (or txt) records via the form!

 

And success!

 

Image 009.png

 

HTML files will show up and be easily visible in SharePoint (you can even add a button and edit HTML files, though I don't think I'd necessarily add this customi...). The same is true for TXT files.

 

Unfortunately the HTML files are not quite as pretty in Teams at this time, and will show  the code and line numbers. The txt file view will also show the line numbers, and are not quite as visibly appealing, but are still effective for maintain a record from a form entry.

 

Text in Teams:

Image 008.png

 

 

HTML in Teams:

 Image 007.png

 

 

There are several PowerShell scripts that will allow you to convert .txt and .html documents to many other formats if needed (I'd recommend PDF or DOCX). This could also be added to the Flow above as part of the automated process, depending on the script you choose.

 

Thanks for reading!

 

My next post will focus on how to automatically publish a more appealing webpage to Azure Blob Storage via a very similar process!

Meet Our Blog Authors
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Cambridge UK Power Platform User Group Leader, Technical evangelist and speaker. Always says yes to coffee! #LetsGetCoffee
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor
  • I am building business processes and applications that are easy for users' to stick to, so they can follow and understand them. In overall I transform processes to be more reliable and effortless. I am a proud co-organizer of SharePoint Saturday Warsaw and active community member, blogger and international speaker.