cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ilu989
Advocate II
Advocate II

How to update the file from SharePoint library file to SharePoint list with no unique key

Hi Everyone,

 

I have seen some written has explained how to "update/add a row" for the list from excel file, but both of them need a unique key to recognize, is there has anyway that doesn't need the "unique key" to approach the updating/add a row matter?

Because I set the Excel table header is 100% the same as List's header, so is it possible to compare the whole row content between Excel and List, then recognize the data, if the same→do nothing, different→update the data, empty→add a row from Excel data?

 

The website I have seen:

http://john-liu-ppph.squarespace.com/?offset=1530030752131

https://veenstra.me.uk/2018/12/03/microsoft-flow-import-list-data-from-an-excel-spreadsheet-into-sha...

https://www.youtube.com/watch?v=qxuTVjQbECo

https://www.slideshare.net/lingualizer/import-excel-rows-to-sharepoint-list

https://powerusers.microsoft.com/t5/Building-Flows/Create-Update-Sharepoint-List-using-an-Excel-List...

 

I try to use the below flow to approach, but no success, please give me any suggestions, thanks.

 

cell.JPG

Filter array 23(body):

[

  {

    "1": "ELAIN",

    "2": "BBA",

    "3": "Training",

    "4": "YES",

    "5": "ELEJL",

    "6": 43731,

    "7": "ASAP",

    "8": "OLC",

    "9": "HK",

    "10": "PHIFKN",

    "11": "Pondin",

    "12": 706759,

    "13": "",

    "14": "36279bac ",

    "15": "",

    "16": "",

    "17": "",

    "18": "",

    "19": "",

    "20": "",

    "21": "",

    "22": "",

    "23": "",

    "24": "",

    "25": "",

    "26": "",

    "27": ""

  },

  {

    "1": "EmABC",

    "2": "GBA",

    "3": "Training",

    "4": "YES",

    "5": "KKY",

    "6": 43731,

    "7": "ASAP",

    "8": "CMC",

    "9": "TH",

    "10": "Noph",

    "11": "TEST",

    "12": 706759,

    "13": "",

    "14": "10385",

    "15": "",

    "16": "",

    "17": "",

    "18": "",

    "19": "",

    "20": "",

    "21": "",

    "22": "",

    "23": "",

    "24": "",

    "25": "",

    "26": "",

    "27": ""

  }

]

Select 6:   

{

  "1": @{concat(item()?['OData__x0031_'], '')},

  "2": @{concat(item()?['OData__x0032_'], '')},

  "3": @{concat(item()?['OData__x0033_'], '')},

  "4": @{concat(item()?['OData__x0034_'], '')},

  "5": @{concat(item()?['OData__x0035_'], '')},

  "6": @{concat(item()?['OData__x0036_'], '')},

  "7": @{concat(item()?['OData__x0037_'], '')},

  "8": @{concat(item()?['OData__x0038_'], '')},

  "9": @{concat(item()?['OData__x0039_'], '')},

  "10": @{concat(item()?['OData__x0031_0'], '')},

  "11": @{concat(item()?['OData__x0031_1'], '')},

  "12": @{concat(item()?['OData__x0031_2'], '')},

  "13": @{concat(item()?['OData__x0031_3'], '')},

  "14": @{concat(item()?['OData__x0031_4'], '')},

  "15": @{concat(item()?['OData__x0031_5'], '')},

  "16": @{concat(item()?['OData__x0031_6'], '')},

  "17": @{concat(item()?['OData__x0031_7'], '')},

  "18": @{concat(item()?['OData__x0031_8'], '')},

  "19": @{concat(item()?['OData__x0031_9'], '')},

  "20": @{concat(item()?['OData__x0032_0'], '')},

  "21": @{concat(item()?['OData__x0032_1'], '')},

  "22": @{concat(item()?['OData__x0032_2'], '')},

  "23": @{concat(item()?['OData__x0032_3'], '')},

  "24": @{concat(item()?['OData__x0032_4'], '')},

  "25": @{concat(item()?['OData__x0032_5'], '')},

  "26": @{concat(item()?['OData__x0032_6'], '')},

  "27": @{concat(item()?['OData__x0032_7'], '')}

}

cell2.jpg

 
Condition 5:
concat(items('Apply_to_each_16')?['1'], items('Apply_to_each_16')?['2'], items('Apply_to_each_16')?['3'], items('Apply_to_each_16')?['4'], items('Apply_to_each_16')?['5'], items('Apply_to_each_16')?['6'], items('Apply_to_each_16')?['7'], items('Apply_to_each_16')?['8'], items('Apply_to_each_16')?['9'], items('Apply_to_each_16')?['10'], items('Apply_to_each_16')?['11'], items('Apply_to_each_16')?['12'], items('Apply_to_each_16')?['13'], items('Apply_to_each_16')?['14'], items('Apply_to_each_16')?['15'], items('Apply_to_each_16')?['16'], items('Apply_to_each_16')?['17'], items('Apply_to_each_16')?['18'], items('Apply_to_each_16')?['19'], items('Apply_to_each_16')?['20'], items('Apply_to_each_16')?['21'], items('Apply_to_each_16')?['22'], items('Apply_to_each_16')?['23'], items('Apply_to_each_16')?['24'], items('Apply_to_each_16')?['25'], items('Apply_to_each_16')?['26'], items('Apply_to_each_16')?['27'])
 
concat(items('Apply_to_each_18')?['1'], items('Apply_to_each_18')?['2'], items('Apply_to_each_18')?['3'], items('Apply_to_each_18')?['4'], items('Apply_to_each_18')?['5'], items('Apply_to_each_18')?['6'], items('Apply_to_each_18')?['7'], items('Apply_to_each_18')?['8'], items('Apply_to_each_18')?['9'], items('Apply_to_each_18')?['10'], items('Apply_to_each_18')?['11'], items('Apply_to_each_18')?['12'], items('Apply_to_each_18')?['13'], items('Apply_to_each_18')?['14'], items('Apply_to_each_18')?['15'], items('Apply_to_each_18')?['16'], items('Apply_to_each_18')?['17'], items('Apply_to_each_18')?['18'], items('Apply_to_each_18')?['19'], items('Apply_to_each_18')?['20'], items('Apply_to_each_18')?['21'], items('Apply_to_each_18')?['22'], items('Apply_to_each_18')?['23'], items('Apply_to_each_18')?['24'], items('Apply_to_each_18')?['25'], items('Apply_to_each_18')?['26'], items('Apply_to_each_18')?['27'])
 
 
Regards,
ilu989
4 REPLIES 4
v-bacao-msft
Community Support
Community Support

 

Hi @ilu989 ,

 

I think that "different→update the data, empty→add a row from Excel data" is difficult to define as if they have coincident parts.

First of all, we can't judge the state of empty, and it is difficult to distinguish if several fields in the item are empty.

I am afraid that this method of your application is not suitable for this requirement.

 

If you don't have a unique key, you could try using multiple fields as a union primary key, such as selecting Column1/Column2/Column3 as the union primary key.

Only the values of the three fields in Item and row are equal, and it is judged as same. If it is not equal, it is judged as different. If the three field values do not exist in item, it is judged as empty.

Hope it makes sense.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-bacao-msft 

 

Yes, it makes sense!!

Thanks for your suggestion, this is the way to produce the unique key from the excel table!!! Because I'm new in the flow and didn't contact kind of expression before, can you give me some suggestions or examples for what action can combine to use "union with multiple fields" on extract the data from Excel?

 

Regards,

ilu989

 

Hi @ilu989 ,

 

Add a field in the SharePoint list and Excel table, the value of this field is composed of the values of the other three fields, you could consider add + in this field value.

 

If there is no such a column, we can't update the row because the Update a row action requires a key column, and the column obviously needs to be non-empty and have a unique value.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-bacao-msft ,

 

YES!

I follow your instruction, use expression "concat" to collect all column value to be a string, and compare with my source data(concat's  string), it's work to filter the items that are new or existing in the excel table, though I can add rows into the excel table, but stuck in the "update a row" cause of the key column and key ID requirement, but when I use the connector "List rows present in a table", it seems to be Excel rows have the item: "itemiternalid", is it possible to use it for the key column ID and figure it out to solve the key column, it could finally update the data without key column?

Below is concat part of my flow:

Inkedupdate excel_LI.jpg

 

 

Otherwise, I refer to the below website, it seems update row only needs the row id(is it the old connector?), can I update like this?

https://melihubb.com/2017/09/08/track-time-at-client-sites-with-the-click-of-a-button-using-microsof...

 

In addition, I'm thinking about this way:

1. Use flow to add/update data to SharePoint list(cause it only needs ID to identify the rows, and could be updated by the items ID)

2. Export the SharePoint list to Excel file(Excel's data will be linked with SharePoint, and could be refresh by Cltr+Alt+F5)

3. Upload the Excel file to SharePoint Library

4. Let the Excel file refresh automatically in Sharepoint setting, then I don't care the unique key, the result achieves what I want.

 

 

But I'm stuck in the refresh the excel file automatically in SharePoint, do you have any idea how to do it?

 

Regards,

ilu989

Helpful resources

Announcements

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Top Solution Authors
Users online (4,446)