Hello guys!
I have a list on Sharepoint where I need to update it with a new list.
It basically works like this: I take the ID that I have in excel from a new list and compare it with the ID that is already there in the Sharepoint.
Example:
If IDExcel = IDSharepoint, update item. And so far it works very well!
But there is the case that: If there is no IDExcel within the Sharepoint list, create a new item. And this case is not working. Look at how I'm trying to do:
EXAMPLE=
IDExcel = "123456", and I want to know if this IDExcel exists within the Sharepoint list.
Value is the output of "Get Items", and I want to check if there is an ID inside the Value.
It doesn't have to be done exactly that way, but that's what I've managed to think so far.
Look at the IDLinha field inside the Value, this is what I need to use to compare::::::
So what I need is: check if an ID exists within my Sharepoint list and if it does not exist, create an item. But this comparison is not working, any ideas?
THANK YOU!!!
Thank you so much @NorthernChuck !! @Paulie78 's solution solved the problem, and thank you so much for taking the time to help me with this. ❤️
I'm so grateful!!!! ❤️
WOOHOO OMG! NO PROBLEM AT ALL, MY PLEASURE! 😂🤣
OMG!!!!!! IT WORKED!!! THANK YOU SO MUCH @Paulie78 . OMG!!
I WAS ALREADY LOST WITHOUT KNOWING HOW TO MAKE THIS WORK, THANK YOU SO MUCH!!!!!
That makes sense to me. It would explain why the comparison wasn't working. Of all the small itches I have with PowerAutomate, I miss having a shell that provides feedback the most! Kudos on the excellent reply with a gif animation!
Your approach will not work because you are comparing the "Value" element from the get items action which is an array of objects. What you need is an array of IDs from SharePoint which will make your comparison work. You can do it with a select action like this:
This will produce you a clean array of IDs, which will look something like this:
[
1,
2,
3
]
You can then easily do your comparison:
Does that make sense?
I am having the exact same issue myself ... trying to compare an ID column in a SharePoint list to the ID column in a .csv file. If the Excel ID exists in the SPO list, update that list item with the data in the .csv file. Otherwise, create a new SPO list item and populate with .csv data.
I was following along with a YouTube tutorial (Power Automate - Bulk Add Excel data to SharePoint list), but the OData filter query isn't working for me. I was using: LMSEnrollmentID eq 'ID' in the SharePoint Get Items action, where LMSEnrollmentID is a column in the SPO list and ID is a column in the .csv file. I'll be following this thread to see how it works out!
So, the easiest way for me to help you is to try and recreate myself. I'll gladly help, but your sample data is in a picture format and it's rather large. Can you paste me in text that sample payload (replace things like Display Name: Kermit Frog, Email: kermit@frog.com - I just need sample data to reproduce)
#2 @vikulkar is very correct in their suggestion. Filtering using an Odata query would accomplish what you are looking for. If you had to, you could load the file more than once and then have more than one singular Odata filter to match up with your "series of treatments"
No worries @carudev !! 🙂 We will get to the bottom of this elusive evaluation.
Unfortunately I am out for the day, but I will review your post either later this evening or tomorrow morning!
Cheers,
~C
My flow works like this:
Every day I receive an email with an excel file, so I get this excel and "ForEach" line inside it I compare it with the lines there in the Sharepoint list, if the file ID is the same as the ID in the Sharepoint list, I update it the item. And it works well, as I compare item by item using the ForEach ID on Sharepoint.
So now I need to deal with cases where the item in the file does not exist in the sharepoint. So I take the IDExcel that came in the file and check if that ID already exists or not in Sharepoint, because if it does not exist I will create it there in the Sharepoint list.
Below more details of my flow:
I use Get Items, then I use a For Each to work with the lines in the file, split them up and do a series of treatments on the lines:
And then I compare the line ID of the file with all the lines in the Sharepoint:
Value comes from Get Items, and this is its content of Value:
And the "Saidas" is this: that is the ID that I already have - it was extracted from the excel file - and I want to know if it already exists or not in Sharepoint.
Thank you guys! Sorry for the terrible English, but I think now I have better explained my problem. Thank you!
@carudev I'm following your logic. I trust that the data is there (or in this case not there). What I'm trying to help with is the evaluation. I'd really like to see the actual output of your evaluation of Value Nao Contem Saidas I'm convinced it's something there.
If not, can you provide some sample data with 1 or 2 rows (records)? This way I can test as well. I once had a select that needed me to manually write out item() function with the array index number of 0. I find when things like evaluations don't work it's because of the expression.......
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2