Home >Tips >SharePoint Flows >Task progress bar kalmstrom.com site map icon Site map  

Update a Progress Bar in a Tasks List

A SharePoint Flows tutorial by Peter Kalmström

Flow iconA flow can give a graphical representation of information that changes often. You can for example let a flow update a progress bar in a Tasks list each time a "% Complete" value is changed.

In the demo below, Peter Kalmström, CEO and Systems Designer of kalmstrom.com Business Solutions, shows how to create such a flow for progress bar updates.

Progress bars in Tasks listPeter uses a list that build on the Tasks template, but he changes the content type into a type that has a "Progress" site column.

If you want to create the flow for just one list, you can keep the default content type and just add a list column for the progress bar instead. It must be a multiple lines of text column with Enhanced rich text enabled.

Hide the "Progress" column from the form

Users don't need the Progress column when they fill out the item forms, so it is suitable to hide it there.
  1. Allow management of content types under List settings Advanced settings.
  2. Open the content type you use for the list.
  3. Open the column you want to hide and select the option 'Hidden'.

The progress bar HTML code

The HTML code used for the progress bars in the image above is:
<table style="width: 100px; border: 0px">
<tr>
<td style="padding: 0px; width: 100px; background-color: green"></td>
<td style="padding: 0px; min-height: 16px; background-color: red"></td>
</tr>
</table>

NOTE: “100” is marked bold above, because in the flow it will be replaced by dynamic content that calculates the required width.

Steps to create a flow that updates progress bars

You can build other graphics in a similar way, for example for conditional formatting.
  1. At https://flow.microsoft.com/, go into 'My Flows'  and click on 'Create from blank'.
  2. Select the trigger 'SharePoint – When an item is created or modified'.
  3. Select the SharePoint site URL, or enter the URL as a custom value.
  4. Select the SharePoint Tasks list or enter its name as a custom value.
  5. Click on 'New step' and then 'New action'.
  6. Select the action 'SharePoint - Update item'.
  7. Select the same site and list as in step 3 and 4.
  8. At Id, add the dynamic content ‘ID’.
  9. At ‘Task Name’ the dynamic content ‘Task Name’.
  10. At ‘Progress’, enter the progress bar HTML code. Calculate the pixels needed for the width by replacing 100 in “width:100px” with an expression:
    1. Start typing “mul” and select it among the suggestions, to multiply.
    2. Add a parenthesis
    3. Put the cursor inside the parenthesis and select the dynamic content “% Complete”.
    4. Add “,100”.
    5. Remove “100” after “width:” in the HTML code and keep the cursor at that place.
    6. Click OK under the expression.
  11. Remove the default entries in other fields so that all fields are empty except the ones you have filled out.
  12. Save and test the flow


Read the blog post about this flow!



Learn more



---------------------------------------------------------------------------------------







Always the latest news in the kalmstrom.com blog



Follow kalmstrom.com on LinkedIn Facebook, Google+  or Twitter!

back icon next icon