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 🙂
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?
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')))
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
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?
Keep up to date with current events and community announcements in the Power Automate community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!