Skip to main content

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.  sad.png  

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:
 217946_pastedImage_2.png217948_pastedImage_4.png

Splitting the mxt variable into a collection via RegEx:

217949_pastedImage_5.png

Log History Results of collection before and after removing the header row:
217950_pastedImage_7.png

For Each Loop config screen:
217951_pastedImage_9.png
Query List Config Screen
217953_pastedImage_1.png

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.
217954_pastedImage_3.png 217958_pastedImage_5.png

Engineering List Item ID=390
217959_pastedImage_11.png

Thoughts on what is causing the workflow to fail when comparing the file values to the list items? Workflow attached.

The collection data is not proper. it should be like PRJ01;PRJ02;PRJ03. Your collection data is having some enter symbols.

So use one more regular expression to form the data correctly into a collection.

218016_pastedImage_1.png

And use For each and update actions to update project status.

Thanks,

Lakshmi


Hi!!

THANK YOU!  I knew it was something simple I was missing but had wrestled with it so much I was looking right past the obvious.


Many thanks.  


Reply