Cheers, yes set that up as such in the meantime.
I'm setting the Coll_IDs variable as a List Item ID then the For Each Action like this:
and then when I come to the Collection operation action it's giving me the CollectedHRDates as the Target Collection but no options under the Index drop down?
you have to create a numeric variable to be used as an collection index
Thanks! I'll give it a whirl and let you know what happens!
I didn't get any notification at all this time?
your query list action likely didn't return any items ...
Right, this is what I have in the CAML editor:
<Query>
<Lists>
<List ID="{15E889B2-D646-46CE-9D8B-D7F13364C7F3}" />
</Lists>
<ViewFields>
<FieldRef Name="Last_x0020_Name" />
</ViewFields>
<Where>
<Eq>
<FieldRef Name="StartDate" />
<Value Type="DateTime" IncludeTimeValue="True">{WorkflowVariable:InputDatePlus20min}</Value>
</Eq>
</Where>
</Query>
Could it be the <FieldRef Name="Last_x0020_Name" /> line?
no, that's correct I think.
but you have changed comparison operator to Equal.
as far as I can see from your previous screenshots, your StartDate field is configured to hold just dates without time. with CAML above you request to compare including times. so you effectively compare some time value within the day against the midnight. and that very likely do not match any item.
Thanks again for all your help Marian I really appreciate it.
I was getting an error on the workflow so I deleted the Query action and set it up again with adding the extra code in the CAML editor. I'm now not getting an alert at all but the workflow is showing that it's completed. I think you're right. I think it's not finding any results cause of the time. The only reason I've set it as a 20 minute increment is for testing purposes (eventually when I get this working it'll be a 7 day alert) . I don't want to wait a day to see if the workflow works, I think it's down to the time element. So if I was to change the Start Date to a Date and Time field on the InfoPath form would that show results (I'm going to try it) or is there a way that if I change the Calculate date action to value days 1 than I can test it immediately?
No, still not getting anything. This is what I've got in my CAML editor:
<Query>
<Lists>
<List ID="{15E889B2-D646-46CE-9D8B-D7F13364C7F3}" />
</Lists>
<ViewFields>
<FieldRef Name="ID" />
</ViewFields>
<Where>
<Eq>
<FieldRef Name="Dateand_x0020_Time" />
<Value Type="DateTime" IncludeTimeValue="True">{WorkflowVariable:InputDatePlus20min}</Value>
</Eq>
</Where>
</Query>
what's the InputDatePlus20min value you supply to the CAML at runtime?
based on your list data screenshot from above I believe following query
<Query>
<Lists>
<List ID="{15E889B2-D646-46CE-9D8B-D7F13364C7F3}" />
</Lists>
<ViewFields>
<FieldRef Name="ID" />
</ViewFields>
<Where>
<Eq>
<FieldRef Name="Dateand_x0020_Time" />
<Value Type="DateTime" IncludeTimeValue="True">2017-11-14T00:00:00</Value>
</Eq>
</Where>
</Query>
should return two items - Baker and Davison
It's this below. Does it matter that the Baker and Davison items don't have the Time input on the form?
I've replaced the {workflow variable..} with 2017-11-14T00:00:00 in the CAMeditor to see what it does.
No didn't get anything and the Workflow History is saying that the workflow completed.
I meant what's the value of InputDatePlus20min variable after calculate date action - you have to write it to history log and check it there.
can you try the same CAML without IncludeTimeValue clause?
just right now I've spot you compare "Dateand_x0020_Time" field in recent CAML, but before you compared "StartDate".
so, what's the field you want to actually compare to?
I thought the time might be an issue so I added a field to the form called DateandTime where the time could be input.
I looked at the history and got this. Does it mean that it's not getting to the Collection Operation action?
This is the For Each
I've taken IncludeTimeValue out to see what that'll do.
Those actions are not being executed (they almost appear to be disabled but that just might be the screen shot). What is happening is there are no items in your collection. Check the index size of your CollectedHRDates..... Oh by the way it looks like you areusing CollectedHRDates and then storing it into a variable called Coll_IDs... this may just be your naming convention, but Coll_IDs should really be a string variable that is storing the ID of the current item. CollectedHRDates is full of the item IDs correct?
Cheers. How would I check the index size of CollectedHRDates? So you're saying Mike that nothing's been stored in the CollectedHRDates Collection so that's why the actions aren't being executed?
On the For each action I'm targeting the CollectedHRDates and storing them in the Coll-IDs list item I
Should I be storing some earlier results in CollectedHRDates?
I've been following steps from yesterday and I can see that she's set up a collection variable called Coll_IDs (which is CollectedHRDates in my workflow) and it doesn't look that that variable is used earlier in Workflow?
Hi Darren,
Right - if the collection is empty the foreach won't execute because it has nothing to loop over. Check your Query List action - something inside of Query List action. Most likely it is the value of your dates not matching what it expects. Question - do you care about the time portion of the date or merely want to retrieve items after X amount of days?
Thanks,
Mike
let's start over from the step by step example I posted above.
I've shown you how to configure what action and where to use which variable. but you seem to again fallen to your former wrong settings.
as well, it seems you did some changes and tests out of the recommendations provided, but reported them back as if recommendations were wrong. to be honest, I'm lost right now what is your current workflow setup, list configuration, list content, etc.
so please review carefully that post once again and configure the workflow by that.
if you still do not get it working, post configuration of each of your actions, configuration of involved list fields and current sample data from your list.
hope that will bring us back on track.
and not to forget, as Mike Matsako pointed out, you have for any reasons disabled collection operation and send notification actions within the loop. despite not executed, they should by drawn with colored icons but without green highlighting.
go to the designer, click the arrow icon on the top right of each action and enable them
Hi Marian
Thanks for your patience! Just took another look and suddenly saw what you said about the equals rather than the greater than! Corrected it, but no luck. I think I've got what you posted, but I'll go through it now in case. , yes the time isn't important, I'm just using that s a test, the date and how many days has elapsed is the important one.
Stage one - Calculate date - the InputDatePlus20min variable is a single line of text
Stage two - Query list - the CollectedCheckDate variable is a collection
Stage three - CollectedHRDates is a collection (it's the only collection ableto access on the drop down) varCurrTitle is a single line of text and idx is a number
Stage four - Collection operation
Stage five - send notification - a bit of a scatter gun to see what comes out, so far nothing has!