I'm working on what I thought would be a simple workflow as it's similar to another workflow I built using the Query List function, but it's not producing the desired results, and I'm at a loss as to why.
The basics:
1. There's a list of Engineering Projects, with the following metadata relevant to this problem (Project ID and Active/Completed)
2. Each week I'll be receiving a .csv file of projects that have completed - the data just consists of the Project IDs of any completed projects so it's one column. This file will save to a SharePoint Library.
3. I need to compare the projects in the weekly report against the projects in the Engineering Project List. When there's a match, the workflow should set the Active/Completed column for that list item to Completed.
The approach:
1. I've parsed the .csv file and saved the Project IDs to a collection.
2. Then I use a For Each Loop to check each collection item against the Engineering Project List for a match.
3. When I enter in a value I know exists in both the csv file and the Project List, the Run Now feature returns accurate results (the item's List Item ID).
4. When I run the workflow, and use the text variable that pulls each collection item for the comparison, the workflow tells me there's no match. However, for testing purposes, I created the .csv file using a subset of the projects on the Engineering Project List. So, the workflow should be returning IDs for each collection item and flipping the Active/Completed setting.
The Project ID column in the list is a single line of text column. The collection items come through as a single line of text variable. Yet the comparison always fails.
I've logged the variable value and sent the data back to me in an email to see what's listed - and I can see no extraneous characters that would prohibit the values from matching. I can only guess there's some mystery character coming through with each collection item, but I can't see any.
Getting the .csv file data:
Splitting the mxt variable into a collection via RegEx:
Log History Results of collection before and after removing the header row:
For Each Loop config screen:
Query List Config Screen
Notes on this action: I've tried running the query with and without item limits and saving the ID as both a number variable and a List Item ID variable. What follows is the Run Now results when I enter an actual value from the .csv list and the email when I run the workflow.
Engineering List Item ID=390
Thoughts on what is causing the workflow to fail when comparing the file values to the list items? Workflow attached.