I have an issue where I've created a custom list in Sharepoint online. If an Item in the list is modified it sends an email to another department, before copying the item to a 'completed' list and deleting the original. Nice and easy, and I've done it before today without issue mainly with pull down lists.
The Column in question is 'Purchasing_Comments', and its looking for the word DONE however the Flow isn't working. The error is
InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2136': 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string. The provided value is of type 'Null'.'.
Ive checked the Output of the failed flow, and the column 'Purchasing_Comments' isn't in the OUTPUT references which is puzzling and may be the cause of the error message.
So, I've recreated the list from scratch in the hope that perhaps the new list will show my column in Output, however my new list with test entries is failing with an issue noted with the original list.
When checking the advanced Edit, the syntax is @contains(triggerBody()?['OData__x0066_mc2'], 'DONE') when surely the [Purchasing_Comments] should be there. I've changed this but its still failing...
I've used this format of triggers for a few FLOWS (mostly pull down lists with the word DONE) but I'm a bit stumped as to where to start first. This is a live list and i'm having to upset two departments with this annoying issue.
What’s the column type of the column “Purchasing_Comments” on your side?
According to your description, I create a flow with a Condition to test this issue.
I try with both Text column type and Choice column type. Both are working fine when I modify the list item to run the flow.
This is my flow configuration (a test when the Comment column is a Choice column):
In advanced mode, the condition is looking like:
Please make sure the dynamic content you selected for the Condition is the column “Purchasing_Comments”.
Please try to start a new flow to test this issue. I assume the Condition should work.
If you need more help, please feel free reply.
Thanks for your reply Mabel.
In the end I did change the DONE format to a pull down list, and thanfully that worked.
My original choice was a multi line text column (Basic), and in tests it ran fine. The only thing was I did iniially import the excel data in via the import spreadsheet app.
As this was giving me the problems I then proceeded to recreate from scratch via custom list. After a few entries I put a new flow in action, but that was failing to run at all.. still had issues with naming conventions (the column name was not replicating to the advnaced mode syntax)..perhaps it was just my account and FLOW that day..it can be troublesome...!
I've just gone back to my test run. When I 'edit' the flow, the dynamic content initially flashes as 'OData__x0066_mc2' before reverting back to Purchasing_Comments. Where can these parameters be viewed and verified ?. I'm assuming deep into SPD13 may find some clues, but I'm trying to avoid SPD13 when we are encouraged to use the new apps from MS.
..now i've got to look into approvals and worksflows with my firms transition to Sharepoint Document Management.. 😞
The reason that it isn't working is because the field that you're trying to match against is blank. For some odd reason Microsoft doesn't take null values into account when matching against contains or equals.
You can add another condition using @empty to check if it's blank and then run your statement against values that aren't blank.