How would I modify this code from @Doug_Den_Hoed__AtAppStore to reflect a single status change. For instance when a project goes into status "On Hold". Everytime I try and do it myself it updates using $$NOW time when another field is being updated, am banging my head against my desk (metaphorically) trying to figure this out, please help. I modified $$NOW to show UTC time to create a scenario in Fusion using this field.
Target:
{status}
Target History:
LEFT(IF(LEFT(Target History,LEN(IF(ISBLANK({Target}),"-",{Target})))={Target},Target History,CONCAT(IF(ISBLANK({Target}),"-",{Target})," (",$$NOW,") | ",{Target History})),2000)
Modified $$NOW time UTC:
CONCAT(
YEAR($$NOW),"-",
IF(MONTH($$NOW)<10,CONCAT("0",MONTH($$NOW)),SUB(MONTH($$NOW),7)),"-",
IF(DAYOFMONTH($$NOW)<10,CONCAT("0",DAYOFMONTH($$NOW)),DAYOFMONTH($$NOW)),"T",
IF(HOUR($$NOW)+7>24,CONCAT("0",SUB(HOUR($$NOW),24)),IF(HOUR($$NOW)+7<10,CONCAT("0",HOUR($$NOW)+7),HOUR($$NOW)+7)),":",
IF(MINUTE($$NOW)<10,CONCAT("0",MINUTE($$NOW)),MINUTE($$NOW)),":",
IF(SECOND($$NOW)<10,CONCAT("0",SECOND($$NOW)),SECOND($$NOW)),".000Z")
)
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
here is an example of a one-time-set calculated field
IF(
ISBLANK({DE:status set to NEW})&&{status}="NEW",
$$now,
{DE:status set to NEW}
)
The logic is simple: If the field is blank and the current status is NEW - set the field to $$now, otherwise, keep the value (literally, re-set it to its current value)
If you want to get more fancy, format your own date/time string (pain in the neck but i needed to see seconds for testing)
IF(ISBLANK({DE:status set to NEW})&&{status}="NEW", IF(MONTH($$NOW)<10,"0","")+MONTH($$NOW)+"/"+IF(DAYOFMONTH($$NOW)<10,"0","")+DAYOFMONTH($$NOW)+YEAR($$NOW)+" "+IF(HOUR($$NOW)<10,"0","")+HOUR($$NOW)+":"+IF(MINUTE($$NOW)<10,"0","")+MINUTE($$NOW)+":"+IF(SECOND($$NOW)<10,"0","")+SECOND($$NOW),{DE:status set to NEW})
I had 3 fields and timestamped on NEW, INP and CLS - these stay the same even when I press recalc, or otherwise edit the issue.
here is an example of a one-time-set calculated field
IF(
ISBLANK({DE:status set to NEW})&&{status}="NEW",
$$now,
{DE:status set to NEW}
)
The logic is simple: If the field is blank and the current status is NEW - set the field to $$now, otherwise, keep the value (literally, re-set it to its current value)
If you want to get more fancy, format your own date/time string (pain in the neck but i needed to see seconds for testing)
IF(ISBLANK({DE:status set to NEW})&&{status}="NEW", IF(MONTH($$NOW)<10,"0","")+MONTH($$NOW)+"/"+IF(DAYOFMONTH($$NOW)<10,"0","")+DAYOFMONTH($$NOW)+YEAR($$NOW)+" "+IF(HOUR($$NOW)<10,"0","")+HOUR($$NOW)+":"+IF(MINUTE($$NOW)<10,"0","")+MINUTE($$NOW)+":"+IF(SECOND($$NOW)<10,"0","")+SECOND($$NOW),{DE:status set to NEW})
I had 3 fields and timestamped on NEW, INP and CLS - these stay the same even when I press recalc, or otherwise edit the issue.
Thanks for the quick response. Is it possible to add, if status changes from NEW, set back to blank?
Views
Replies
Total Likes
Not sure i understand the rationale - but this formula will set the field to a dash if the status is not NEW
( setting a calculated field to emptystring doesn't work )
IF(
{status}!="NEW",
"-",
IF(
(ISBLANK({DE:status set to NEW reset}) || {DE:status set to NEW reset}="-")&&{status}="NEW",
IF(MONTH($$NOW)<10,"0","")+MONTH($$NOW)+"/"+IF(DAYOFMONTH($$NOW)<10,"0","")+DAYOFMONTH($$NOW)+"/"+YEAR($$NOW)+" "+IF(HOUR($$NOW)<10,"0","")+HOUR($$NOW)+":"+IF(MINUTE($$NOW)<10,"0","")+MINUTE($$NOW)+":"+IF(SECOND($$NOW)<10,"0","")+SECOND($$NOW),
{DE:status set to NEW reset}
)
)
Views
Replies
Total Likes
TIP:
This is a good example of how to set a calc field to do it's thing once and then not change again, keeping it's original first calculation.
I use the same logic to see if a task was copied from another project. On my global task form I set a calc field to record the task>projectID and then never change, so when I see one that doesn't match the current projectID, I know it was copied from another project and I know which project it was copied from. Thanks Sven.