Expand my Community achievements bar.

Using a If statement using Contains for a project task field, to return a specific task due date

Avatar

Level 1

Sorry having problems getting any value, true or false for the following script, and not sure why.

 

displayname=Delivery Date
listdelimiter=<p>
listmethod=nested(tasks).lists
textmode=true
type=iterate
valueexpression=IF(CONTAINS("Shipping Ocean",{Project}.{Task}.{name}),{"dueDate"},"0"))
valueformat=HTML

6 Replies

Avatar

Community Advisor

Hi @RichardCl1 - I would give the below a try! Let me know if it doesn't work.

 

 

displayname=Delivery Date
listdelimiter=<div>​
listmethod=nested(tasks).lists​
textmode=true​
type=iterate​
valueexpression=IF(CONTAINS(“Shipping Ocean",{name}),CONCAT({plannedCompletionDate}),"")​
valueformat=HTML​

 

 

Avatar

Level 1

displayname=Delivery Date
listdelimiter=<div>
listmethod=nested(tasks).lists
textmode=true
type=iterate
valueexpression=IF(CONTAINS("Shipping Ocean",{name}),CONCAT({plannedCompletionDate"),"1")
valueformat=HTML

 

The above isn't returning any values still.  I stold the script from an example that was somewhat similar on the board, unfortunately still not getting it done.

 

My concern here is that this is a project level report, and I'm trying to run the IF statement at the Task level, to return the due date for the task.

Avatar

Level 1

If I replace the Concat portion with a fixed value it returns a true statement value, so that's good, but I can't seem to get it to return the date, and it seems to return multiple true values for the single project line.

displayname=Delivery Date
listdelimiter=<div>
listmethod=nested(tasks).lists
textmode=true
type=iterate
valueexpression=IF({task},{name}="Delivery Gate Meeting and Approval","2","1")
valueformat=HTML

RichardCl1_0-1690566353395.png

 

 

Avatar

Community Advisor
displayname=Delivery Date
listdelimiter=<div>​
listmethod=nested(tasks).lists​
textmode=true​
type=iterate​
valueexpression=IF(CONTAINS(“Delivery Gate Meeting and Approval",{name}),CONCAT({plannedCompletionDate}),"")​
valueformat=HTML​

The one you have above appears to be returning the number of tasks from the project with the value as 2. I'm surprised the one above doesn't work...I adjusted the task name to match what you have in the reply.

Avatar

Level 1

This is just strange, I can't figure out why this isn't working, it should be.  Is it that this is a project report and it doesn't see that I'm looking for the Task Name field?  And the Task COmpletion date field?

 

RichardCl1_0-1690571552367.png

 

Avatar

Community Advisor

I don't think you need the CONCAT. That allows you to combine things, such as showing both the Planned Complete Date and something else.

Also be VERY careful, when you copy/paste anything with quote marks into the text mode box, make sure you replace any curly quotes with straight quotes

 

try this:

displayname=Delivery Date
listdelimiter=<p>
listmethod=nested(tasks).lists
textmode=true
type=iterate
valueexpression=IF(CONTAINS("Delivery Gate Meeting and Approval",{name}),{plannedCompletionDate},"")
valueformat=HTML