Forum Discussion

JoelGDucharme's avatar
JoelGDucharme
Copper Contributor
Sep 26, 2024
Solved

Import excel column as an item in SharePoint list

I have a huge excel file with a bunch of tabs that I would like to convert into one SharePoint List through PowerAutomate so that the list is always up to date.

 

All worksheets have the same format. The first column will be the sharepoint columns and the "Colonne2" will be a new item for each of the worksheet. I don't need the "Colonne1" in the SharePoint List.

 

Here is an example of one worksheet:

Numéro de compteColonne1Colonne2
4160Subventions total4000
4310Billeterie 
4351Parrainages   Commandites1500
4353Ventes souvenirs 
4450Revenus divers 
4541Membres ou cartes d'adhésion 
4512Prélèvements 
4530Dons 
4560Ventes à commission d'oeuvres artistique 
4460Ventes boutique 
4550Intérêts 
4650Transferts de garderie codé comme paie de DNSSAB 
4651Transfert de garderie pour événements culturels 
5210Sous contractuel0
5310Transportation10
5311Per Diem   nourriture bénévoles et artistes0
5320Cachets hors Ontario0
5321Cachets artistes Ontario0
5331Hébergement   Artistes Conférenciers0
5332Techniciens300
5334Équipements de programmation   Locations et Achats421
5335Location   lieux, permis de terrain, etc.207,01
5350Publicité483,94
5354Relations publiques (réseautage)0
5356Achats matériaux   prix3 034,15
5415Sécurité0
5420Traiteurs et nourritures pour vendre au public167,72

 

Any ideas how to do this? I want to use PowerAutomate so that the SharePoint list is always current but also gives me the history of each project. I guess I could copy the colums and paste as horizontal on each worksheet, but then the Excel will be clunky. Each worksheet is a project and we will be adding projects all the time.

  • Hi JoelGDucharme, I hope that I understsood the problem correctly. We can create a flow with the following actions:

     

     

    Initialize Object: type object Value {}

    Apply for each: @{outputs('Get_tables')?['body/value']}

    Set reset Object: Value {}

     

    Apply to each row: @{outputs('List_rows_present_in_a_table')?['body/value']}

    Compose: @{addProperty(variables('Object'),items('Apply_to_each_row')?['Numéro de compte'],items('Apply_to_each_row')?['Colonne2'])}

    Set variable : @{outputs('Compose')}

     

    In Compose 2 you can check the result @{variables('Object')}

    which in my case is: 

    {
      "4160": "4000",
      "4310": "",
      "4351": "1500",
      "4353": "",
      "4450": "",
      "4460": "",
      "4512": "",
      "4530": "",
      "4541": "",
      "4550": "",
      "4560": "",
      "4650": "",
      "4651": "",
      "5210": "0",
      "5310": "10",
      "5311": "0",
      "5320": "0",
      "5321": "0",
      "5331": "0",
      "5332": "300",
      "5334": "421",
      "5335": "207,01",
      "5350": "483,94",
      "5354": "0",
      "5356": "3 034,15",
      "5415": "0",
      "5420": "167,72"
    }

     

     

8 Replies

  • michalkornet's avatar
    michalkornet
    Iron Contributor

    Hi JoelGDucharme, I hope that I understsood the problem correctly. We can create a flow with the following actions:

     

     

    Initialize Object: type object Value {}

    Apply for each: @{outputs('Get_tables')?['body/value']}

    Set reset Object: Value {}

     

    Apply to each row: @{outputs('List_rows_present_in_a_table')?['body/value']}

    Compose: @{addProperty(variables('Object'),items('Apply_to_each_row')?['Numéro de compte'],items('Apply_to_each_row')?['Colonne2'])}

    Set variable : @{outputs('Compose')}

     

    In Compose 2 you can check the result @{variables('Object')}

    which in my case is: 

    {
      "4160": "4000",
      "4310": "",
      "4351": "1500",
      "4353": "",
      "4450": "",
      "4460": "",
      "4512": "",
      "4530": "",
      "4541": "",
      "4550": "",
      "4560": "",
      "4650": "",
      "4651": "",
      "5210": "0",
      "5310": "10",
      "5311": "0",
      "5320": "0",
      "5321": "0",
      "5331": "0",
      "5332": "300",
      "5334": "421",
      "5335": "207,01",
      "5350": "483,94",
      "5354": "0",
      "5356": "3 034,15",
      "5415": "0",
      "5420": "167,72"
    }

     

     

    • JoelGDucharme's avatar
      JoelGDucharme
      Copper Contributor
      I'm not sure I'm getting this. There seems to be something missing or that I don't understand.
      - I can't find "Initialize Object", "Set reset Object" connectors.
      - Also, how do I refer to the values of the "Apply to each" in the "List rows present in tables" connector?

    • JoelGDucharme's avatar
      JoelGDucharme
      Copper Contributor
      Interesting. So after this, I can just add a "Add an item" loop to create a new sharepoint item in my list?

Resources