Flow - customising the HTML table

(updated  23 May 2019)

Todays snippet - HTML tables in Microsoft Flow - creating spaces between columns.

So i have created a flow to read the Message Center messages and incidents, and and post in teams.
The HTML table element used to build a list of the messages works well, but there little option to format the table itself.

One particularly annoying issues is the tables are all squished together. Not normally an issue for HTML rendering in outlook, when the output is sent via an email.
Teams on the other hand, doesnt do as good a job.

So - how to customise.
Its a bodge, but it works. After creating the table, insert a compose step. Take the output from the table, and replace </th><th> with </th><th>&nbsp</th><th>
This will insert a small header between columns

the function is: replace(body('Create_HTML_Table'),'</th><th>','</th><th>&nbsp</th><th>')

Similarly, you'll need to add a space between the table main cells (and not just the header)

Add a new compose step and take the previous step output:
 replace(output('Compose'),'</td><td>','</td><td>&nbsp</td><td>')

Bodge complete until there are further (supported!) options for the 'Create HTML Table' step.  

Update:
So some changes to the way that flow works. No longer could i find the item, erm, items in the dynamic lists, you have to add them in using the function faciltity, like item()?['fieldname']
Combining this with posting messages to Teams channels lets me push out office 365 health center incidents and advisories.

Note - when checking if an item has been updated or closed, i've had to add two filters - one to check if the item exists first - @not(empty(item()?['LastUpdatedTime'])))
then check if its been updated in the past few minutes - @greaterOrEquals(item()?['LastUpdatedTime'],addminutes(utcnow(), -16))

Theres been some strange results from this recently. Some items don't show, some items are updated from days ago, which didnt originally show when they first occurred etc.
Unsure if its Flow reading the azure application ID or not.

Comments

Popular posts from this blog

Skype Online and MCOValidationError

SCCM 2012 R2 - Offline servicing error

Polycom provisioning - and Zoom!