cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Seek Help : Not able to Create File on Sharepoint having content of all data in CSV Table

Hello Community,

I need your help please.

 

Flow:


Main ImageMain Image

 


Sequence :

1. List Plans for a Group. ( 9 Plans are fetched for a given group "X")

2. List Buckets for each of the Plans listed as part of Step 1. ( Count of Bucket is different for each of the above Plans, and is fetched). It can be seen by selecting/navigating to each of 9 Plans as shown in  below image 1.

 

Image 1Image 1

 

3. However, when I execute Create File (Sharepoint), only the Buckets List for 9th Plan is written in defined  dd.csv.

 

Desired Output:

The File dd.csv should have entries for all the 9 plans, not just 1 plan.

Below is the csv o/p with entry only for last (9th Plan).

@odata.etagnameplanIdorderHintid
W****"T****oz****o8****s4****u

 

Expected:

@odata.etagnameplanIdorderHintid
xBucket 1.1Plan1xx
xBucket 1.2Plan1 xx
xBucket 1.3Plan1 xx
xBucket 2.1Plan2xx
xBucket 3.1Plan3xx
xBucket 3.2Plan3xx
:::::
W****"T****oz****o8****s4****u



 

 

Thanks & Regards,
AGR

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi again!

Create CSV out of the 'Apply to Each' approach. I just have one Plan defined in my test bed, need your help to verify this approach works with more than one:

Flow_Buckets2SingleCSV.png

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Anonymous
Not applicable

Hi @efialttes ,

I followed below approach to get rid of it. Took some modifications of having added variables for it to be aligned properly while converting to csv, but in short, "Appending Array Variable" seems help resolve the case.

Thanks for your help, I'll execute your last recommendation and update shortly. Courtesy you, I could explore the possibility of using expressions. Thanks again.

 

image.png

View solution in original post

8 REPLIES 8
efialttes
Super User
Super User

Hi!
The problem is, you are iterating over all your buckets, in each iteration you are creating a file called dd.csv... meaning each time you iterate you overwrite the previous dd.csv

I guess you expect 9 files to be created right?
If so, I would add bucket id to the csv file name, since this id is unique.

Hope this makes sense


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Anonymous
Not applicable

Hi @efialttes ,

No, I want a single csv file having o/p of all 9 iterations, split by row.

PS:

Below is the csv o/p with entry only for last (9th Plan).

@odata.etagnameplanIdorderHintid
W****"T****oz****o8****s4****u

 

Expected:

@odata.etagnameplanIdorderHintid
xBucket 1.1Plan1xx
xBucket 1.2Plan1 xx
xBucket 1.3Plan1 xx
xBucket 2.1Plan2xx
xBucket 3.1Plan3xx
xBucket 3.2Plan3xx
:::::
W****"T****oz****o8****s4****u



Hi again!
Then you probably need to initialize string variable, then store csv output from each iteration inside by means of an 'append to string variable' to be added inside your apply to each. Please note you will probably need to adapt the csv output before appending it.
Finally, you need to move 'Create file' outside the 'Apply to each', assign as its input the string variable
Hope this makes sense


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



efialttes
Super User
Super User

Hi again!
I am just thinking on a simpler faster approach, that is to use the 'Apply to each' to append 'List buckets' outputs to an array varuable by means of a union() based expression.
Then move 'create csv table' out of the 'Apply to each'
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Anonymous
Not applicable

Thanks @efialttes , I'll try both now. 

Meanwhile, can you please help guide more on usage of Union operator here (with a few image), I am a rookie in flow and have used only dynamic expressions for now. I'll explore, still, a way like above can help me quickly.

Thanks Again 🙂

Hi again!

Create CSV out of the 'Apply to Each' approach. I just have one Plan defined in my test bed, need your help to verify this approach works with more than one:

Flow_Buckets2SingleCSV.png

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Anonymous
Not applicable

Hi @efialttes ,

I followed below approach to get rid of it. Took some modifications of having added variables for it to be aligned properly while converting to csv, but in short, "Appending Array Variable" seems help resolve the case.

Thanks for your help, I'll execute your last recommendation and update shortly. Courtesy you, I could explore the possibility of using expressions. Thanks again.

 

image.png

@Anonymous 

I see you are building your own CSV. Great idea, good job!

As you can see, challenges can be overcome by means of different approaches, all of them with pros and cons.

Thanx for posting your progress here!

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Users online (3,715)