Hi PA community,
I am working on simple flow that will be triggered manually. Scheme will be as follows:
1. Manual Trigger -> 2. Get Items from a sharepoint list by filtering entire list by input from step 1 -> 3. create HTML table from previous 'Get Items' --> 4. send HTML table by email
Re step 3: For each run, the number of items will be different -> the number of rows in the HTML table will be different.
My question:
Is there a way to newly index all items for each run in a separate column (as part of the new HTML table), so that it looks like:
HTML table:
New Index / Column A from sharepoint list / Column B from sharepoint list
1 / value1 A / value1 B
2 / value2 A / value2 B
n / valuen A / valuen B
Many thanks
Hi @sebkath14
Please ignore my earlier suggestion. This will work.
Range expression
range(0, length(outputs('Compose')))
For the serial number No
if(equals(item(), 0), 1, add(item(),1))
Thanks
@abm Thanks again for your hint. Just wanted to follow up on the progress I made. Based on your hint, I also found this resource (https://crmtipoftheday.com/1434/can-you-count-or-how-to-add-index-to-array-in-power-automate/) and I managed to create the new index column, as follows:
I used all the expressions that are mentioned in the linked resource above. My input source is a 'Filter Array' that filtered my 'Get Items'. While the index column (red rectangle) is starting at 1 (likely due to the expression --- range(1, length(outputs(‘INPUT ACTION'))) ---) the other data (Date and Weekdays) is starting with the second "row" of the respective column. For Date it should start with 2nd May (not 3rd May) and Weekday should start with "Montag" and not "Dienstag". All missing data is included in the output of the previous 'Filter Array' action. I assume that the array is displayed zero-based and there is also a hint mentioned in the linked resource, but I do not know how or where to apply it.
When I change the green marked 1 to 0 in the range expression, I get all my data from the previous Filter Array but the index has to start with 1 as it is indexing the number of workdays (and therefore, cannot be 0).
Do you have an idea how the other data could be "moved" by one row to let it start with index 1?
Many thanks!
Hi @sebkath14
Thanks for your quick reply. In your custom array you need to maintain a custom column for the index. Yes eventually that will be in the new html table.
Thanks
@abm Thanks for your message. And by creating my own array from filter results I "create" the information for the new index column (that will eventually be DISPLAYED in the new html table)? Thx
Hi @sebkath14
For this you need to create your own custom array which should keep all the filter results. Once you had all the results then you can use the create html to create the HTML table.
Thanks
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2