web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create a CSV with mult...
Power Automate
Suggested Answer

Create a CSV with multiple values of 2 sharepoint list

(2) ShareShare
ReportReport
Posted on by 691
I am trying to create a CSV file using a Power Automate flow. I have two Sharepoint lists. I have a list "Objectifs" that contains a lookup column called "Site_Rch", and this column "Site_Rch" contains the values ​​of the column "Libelle" of my second SharePoint list "Sites".
I would like to retrieve the values ​​of the "Finances" column in my "Sites" list, but if : Libelle is equal to Site_Rch for each element of my "Objectifs" list.
 
I tried this but I can't do it :
 
 
 
 
 
 
 
 
I want to put "Finances" here : 
 
 
 
 
 
Can you help me please :'( :'( :'( :'( :'( :'( ?
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    This is the case of lookup, for this, try like as shown below
     
    Here I have created 2 SP list,
     
    1. One Source List 1 , which has some columns along with one column as lookup column which reference other sp list.
     
    Here PID is the lookup column to other SP List.
     
    Lookup column is like as shown below
     
    Now for each row in Source List 1, i want to get finance value and attach to it and convert to csv object
     
    see below flow design on how i have acheived it.
     
    1. Use initialize variable to initialize an array like below
     

     
    2. Use get items to get items in source list 1
     
     
    3. Loop through each item of source list 1 using apply to each as shown below
     
     
    Next 2 steps will be in loop
     
    3.1- use get items on lookup list 1 using odata filter query which helps to filter the lookup column value on the other list as shown below
     
    3.2- use append to array variable to append the object we need for creating csv data something like as shown below
    Expression used here- 
    first(outputs('Get_items_2')?['body/value'])?['Finance']
     
    Now we have added an object which contains all attributes which final csv file should have. Now as part of next steps, we will use create csv table action to convert the array variable to csv formatted file which would be done outside loop.
     
     
    Hope it helps !
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
     
  • Hii_iii Profile Picture
    691 on at
    It's very kind of you to reply to me. I followed all the steps you gave me but when the CSV file is created, the "Finances" field remains empty.
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi, 
     
    is the column name different in your case, because for Finance column - column name used was Finance in my example and expression was first(outputs('Get_items_2')?['body/value'])?['Finance']
     
     
    If the column name is Finances in your case, then i think you should use this expression 
    first(outputs('Get_items_2')?['body/value'])?['Finances']
     
    see whether this helps your or not ?
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
     
  • Rana83 Profile Picture
    9 on at
    Nived,
     
    I was looking for a way to reference a second list to get the items and your solution worked fine for me. Thank you very much for your suggestion.

    Is there a way we can use the Select control to avoid the Apply to each loop there by we can reduce the number of API calls.
     
    Regards,
    Rana
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    without using apply to each loop- it would be quite difficult as you need to get list of all items from the second list , but with this loop approach- the amount of items taken from get items action can be reduced by using filter query.
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard