Hi all,
I have created the below flow and it it returning duplicate headers. Is there anyway that I can keep the first header and do away with the duplicates? Tried the union function and concat but must not be using them in the correct order as they haven't worked
Any help is greatly appreciated 🙂
Thank you
Hi @Jojodev86,
I assume your LoopsVar variable is of type integer and starts with a 0? You could use that LoopsVar value to check if it is the first loop. If that is the case you want to use the Header. In all other cases you want to skip that first row.
Below would be an example expression for within the loop (probably for your append to string variable):
if(equals(variables('LoopsVar'), 0), body('Create_CSV_Table'), join(skip(split(body('Create_CSV_Table'), decodeUriComponent('%0A')),1), decodeUriComponent('%0A')))
It is an Integer but begins with a 1... would I include that expression you have commented in the append csv variable but just change what you have written to a 1?
I think the loop can run up to 6 times
Hi @Jojodev86,
If you initalize your LoopsVar variable with 1, than you would need to update the 0 to 1 in the expression.
Can you try the below within your Do Until loop?
if(equals(variables('LoopsVar'), 1), body('Create_CSV_Table'), join(skip(split(body('Create_CSV_Table'), decodeUriComponent('%0A')),1), decodeUriComponent('%0A')))
Hi,
I input the expression next to the output in my append to sting variable and it brought back the data x2
When I try add the expression into IcrLoops it advises that it is invalid
Should I try put the expression in the append to sting variable before the output?
Sorry if I'm confused but it did get rid of the duplicate headers just duplicated the data
Hi @Jojodev86,
Yes, it should be in the append to string variable action.
However, you are also using a Do until. So, with every loop it will collect the data via the Power BI query and adds it (append) to the existing data within the variable.
What do you want it to do? Can you explain why you are using a Do Until?
Hi @Expiscornovus
Thank you, it worked.
However, it is not showing the first header as well.
I need the header for the first loop and rest all it shouldn't.
Hi @Expiscornovus
I found the solution, Thank you.
if(equals(variables('LoopsVar'), 2), body('Create_CSV_Table'), join(skip(split(body('Create_CSV_Table'), decodeUriComponent('%0A')),1), decodeUriComponent('%0A')))
User | Count |
---|---|
16 | |
16 | |
14 | |
9 | |
8 |
User | Count |
---|---|
31 | |
28 | |
24 | |
23 | |
13 |