The scenario is to keep a table updated with Active/Resolved Bugs List in an online sharepoint excel. You will have to manually keep on editing each cell value in excel after opening the DevOps work item links. But with power automate you can do it within 1-2 minutes.
To do this you will have to list all the rows in the excel table, delete all rows, fetch devops queries result, update online excel table and if required an extra step to send an email.
Shown below:
Given below is the online excel table which you have to keep updated
1. Set the recurrence for eg manually trigger the flow
2. List Rows present in a table
3. Apply to each --> use the 'Value' output of 'List rows present in a table' in 'Apply to each' input --> outputs('List_rows_present_in_a_table')?['body/value']
4. in Apply to each add a new step 'Delete a Row'
you can either enter the Query ID from the Query URL or navigate to the query by clicking the folder icon
Now here I have a column in query called 'Assigned To' which has the values in the format of 'Name Surname <email>'. We will separate the Name (Name & Surname combined in this case) and email id and enter into 2 different columns in online excel.
We have to do it on all the query results so we will again use 'Apply to each'.
6. Apply to each --> use 'Value' output of 'Get query results' as input of 'Apply to each' --> outputs('Get_query_results')?['body/value']
7. Inside 'Apply to each' add a new step 'Compose' to split the Name and email id.
split(items('Apply_to_each')?['System.AssignedTo'], ' <')
This will split the 'Assigned To' values into 2 outputs i.e Name & Surname || email>. So outputs('Compose')[0] = Name & Surname || outputs('Compose')[1] = email>. After splitting the value we will have to enter them into online excel file, so we will need to again use multiple compose.
8. Inside 'Apply to each' add a new step 'Compose' for Split [0]
9. Inside 'Apply to each' add a new step 'Compose' for Split [1]
10. Inside 'Apply to each' add a new step 'Compose' for replacing '>' at then end of email.
replace(outputs('Compose_3'),'>','')
11. Inside 'Apply to each' add a new step 'Add a row into table'
Now my table has a column which lists the colour value Red/Yellow/Green. Supposedly we want to send the data of only Red colour.
13. Filter Array
<style>
table {
border: 1px solid #1C6EA4;
background-color: #EEEEEE;
width: 100%;
text-align: left;
border-collapse: collapse;
}
table td, table th {
border: 1px solid #AAAAAA;
padding: 3px 2px;
}
table tbody td {
font-size: 13px;
}
table thead {
background: #1C6EA4;
border-bottom: 2px solid #444444;
}
table thead th {
font-size: 15px;
font-weight: bold;
color: #FFFFFF;
border-left: 2px solid #D0E4F5;
}
table thead th:first-child {
border-left: none;
}
</style>
@{outputs('Compose_5')}
18. Send an email V2
I do not have any problem in this flow. Just posting an idea. @krishsolver
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional