I hope someone can help.
Purpose: Build a flow which compares two columns (A, B) in the source .xlsx file and for every row for which the two columns are different save column B (for those rows for which the cells are different) in a new file and save the file to OneDrive. E.g. for the data source below save values 1 and 3 in a new file.
A B 10 1 5 5 33 33 8 3
What I have done: Please see screenshots below. Basically, I initialise an an array and then within a scope I have a condition which compares colums A and B. If they are not equal, append the output to the array I created earlier. Outside of the condition but within the scope, I create a table that has (should have) the output of the array. Then save this table to OneDrive.
Problem: The file that is created contains as many rows as the output of the comaprison between the two columns. i.e.
my_column ["1", "3"] ["1", "3"]
Any help/advise or links would be much appreciated.
Solved! Go to Solution.
1st: Add a Compose action block prior to "Append to array variable"; assigning the value of b column
Once you execute the flow, go to Run History, select the last iteration and inspect the content of Compose action block in each iteration of Apply to Each where the condition is met. You can also inspect the content of the variable in each iteration.
2nd: Go to Condition, click on "show condition in advanced mode" and verify the expression. From your description and the test data provided, it seems the condition is applying properly, but anyway.
Hope it helps
Hi efialttes [from Greek mythology?]
Thanks for your response.
The problem appears to be how CSV table outputs rather than how "Apply to each" behaves.
See screenshot below; although the input is correct it seems to outputs multiple instances of the same input (as many as the elements of the array]. The same happens with HTML table. Is that a bug?
In any case I was able to circumvent this problem by composing another variable and having it accept as an input the output of the array. But at the moment I cannot use tables.
Happy to hear that you managed to circumvent this problem.
I guess Create CSV table action block is waiting for an array of objects unless you specify a proper value in Advanced Options->Columns. I haven't implemented Create CSV table in my flows yet, but I haved some experience implementing Create HTML table, I usually take Get Items output as the input for Create HTML table (i.e. an array of objects) and I don't remember such weird behaviour.
Moreover, I have defined a very simple test flow by initializing an array variable with the following expression
and then applying it as input for the FRom Property of a Create CSV table action block. I can save the flow, however when executing it I see the following error:
The property 'columns' must be specified unless the 'from' property value is an array of objects.
In your flow, which value did you apply to 'columns'?
Yeah, efialttes is Ancient Greece inspired 😄
I guess Create CSV table action block is waiting for an array of
objects unless you specify a proper value in Advanced Options->Columns.
I think you are right. I assumed that it would have been as simple as puting in the "Value" field in the columns the output of the array itself (see below)
The property 'columns' must be specified unless the 'from' property value is an array of objects
I think this is correct. At least I couldn't myself get away with it without specifying columns.
Any sgguestions how I can create a "proper" table? I am sure it will be needed soon for my purposes.
Many thanks in advance.
Watch Microsoft Business Applications Summit sessions on-demand.
The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!
We are excited to announce the launch of Power Virtual Agents Community. Check it out now!
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
The top training and networking event across the globe for Microsoft Business Applications