cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
YA
Level: Powered On

Confused about CSV table output

Dear All,

 

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.

overall.PNGFlow_Summarytable.PNGtablecondition.PNGcondition

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.

 

Thansk

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Confused about "Apply to each" output

If I declare @item() as value I get the following result

testCSV2.png

 

 

 





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

Re: Confused about "Apply to each" output

Hi!

Two suggestions:

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





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





Highlighted
YA
Level: Powered On

Re: Confused about "Apply to each" output

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.

 

Thanks

error.PNG

 

Dual Super User
Dual Super User

Re: Confused about "Apply to each" output

@YA

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

createArray('a','b','c')

 

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 😄

 

testCSV.png





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





YA
Level: Powered On

Re: Confused about "Apply to each" output

@efialttes

 

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)

output.PNG

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.

Dual Super User
Dual Super User

Re: Confused about "Apply to each" output

If I declare @item() as value I get the following result

testCSV2.png

 

 

 





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





View solution in original post

YA
Level: Powered On

Re: Confused about "Apply to each" output

@efialttes

So many thanks. This solves my problem. I will (attempt to) change the title of the post to reflect the real problem.

 

 

Again many thanks.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 173 members 5,681 guests
Please welcome our newest community members: