Hi @Meagan_Caesar!
It's likely that the error is caused by an empty {Date & Time} field value.
You can add an IF check on this field to remove the error like:
IF({Date & Time},
DATEADD(
DATETIME_FORMAT(
SET_TIMEZONE(
{Date & Time}, 'Australia/Brisbane'), "DD/MM/YY hh:mm a"),
1, 'weeks'),
"")
This is saying, if {Date & Time} is populated, do the inner formula, otherwise, return blank (noted as "").
Checkbox fields evaluate to true or false so adding another IF statement to check whether a checkbox is checked would be:
IF({checkbox},
IF({Date & Time},
DATEADD(
DATETIME_FORMAT(
SET_TIMEZONE(
{Date & Time}, 'Australia/Brisbane'), "DD/MM/YY hh:mm a"),
1, 'weeks'),
""),
"")
Finally, this can be combined into a single IF statement using AND() like:
IF(AND({checkbox}, {Date & Time}),
DATEADD(
DATETIME_FORMAT(
SET_TIMEZONE(
{Date & Time}, 'Australia/Brisbane'), "DD/MM/YY hh:mm a"),
1, 'weeks'),
"")
Hope that helps!
-Stephen
Using DATETIME_FORMAT() and SET_TIMEZONE() should be unnecessary. You can set the timezone shown in the formatting options of the formula.
IF(
AND( {Date & Time}, {Recurring Events}),
DATE_ADD({Date & Time}, 1, "weeks")
)
Hi @Meagan_Caesar!
It's likely that the error is caused by an empty {Date & Time} field value.
You can add an IF check on this field to remove the error like:
IF({Date & Time},
DATEADD(
DATETIME_FORMAT(
SET_TIMEZONE(
{Date & Time}, 'Australia/Brisbane'), "DD/MM/YY hh:mm a"),
1, 'weeks'),
"")
This is saying, if {Date & Time} is populated, do the inner formula, otherwise, return blank (noted as "").
Checkbox fields evaluate to true or false so adding another IF statement to check whether a checkbox is checked would be:
IF({checkbox},
IF({Date & Time},
DATEADD(
DATETIME_FORMAT(
SET_TIMEZONE(
{Date & Time}, 'Australia/Brisbane'), "DD/MM/YY hh:mm a"),
1, 'weeks'),
""),
"")
Finally, this can be combined into a single IF statement using AND() like:
IF(AND({checkbox}, {Date & Time}),
DATEADD(
DATETIME_FORMAT(
SET_TIMEZONE(
{Date & Time}, 'Australia/Brisbane'), "DD/MM/YY hh:mm a"),
1, 'weeks'),
"")
Hope that helps!
-Stephen
Thanks Stephen, this is great info and helps me better understand how to structure these sorts of formulas in the future. Weirdly, there weren't any missing dates, so I'm not sure what was throwing the error, but both your response and Kuovonne's work, so thank you.
Using DATETIME_FORMAT() and SET_TIMEZONE() should be unnecessary. You can set the timezone shown in the formatting options of the formula.
IF(
AND( {Date & Time}, {Recurring Events}),
DATE_ADD({Date & Time}, 1, "weeks")
)
Thanks Kuovonne, this works perfectly and is nice and simple.
Using DATETIME_FORMAT() and SET_TIMEZONE() should be unnecessary. You can set the timezone shown in the formatting options of the formula.
IF(
AND( {Date & Time}, {Recurring Events}),
DATE_ADD({Date & Time}, 1, "weeks")
)
Hi @kuovonne and @Stephen_Orr1 ,
In addition to this question, I'm trying to set up a field to automatically generate due dates based on certain submissions. Here's what I have, but it won't format as a date, only as the string, so I'm not sure what's not working. It seems to only happen when I add the IF statement.
IF({Type of Edits}='Bio draft edits for Author revision',
DATETIME_PARSE(
DATETIME_FORMAT(
DATEADD({Submitted},1,'week'),"DD/MM/YYYY"),
"DD/MM/YYYY"),
" ")
Any help would be greatly appreciated!