Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can you reject Confiform submissions based on the date submitted?

Jane Smith November 27, 2023

Hi there,

I'm new to Confluence/Confiforms, so still learning a lot on the functionality. I'd like to create a rule for my form to reject submissions based on the target date on the form.

For example, let's say we have an Event submission form with a field titled "date" which is when the event is scheduled. There are 2 types of events: internal and external. I'd like for the entry to be rejected and send an email to the user based on one of the two criteria:

1. If event is internal, reject if submission is less than 4 weeks of the "date"

2. If event is external, reject if submission is less than 8 weeks of the "date"

For example, if the form was submitted on 11/27 and the external event is on 11/29, reset and send the user an email detailing the reason why.

1 answer

0 votes
Alex Medved _ConfiForms_
Community Champion
November 27, 2023

Hi @Jane Smith and welcome to this community

You can set up a Validation Rule https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-Validationrule checking for that

Basically checking against the value with added milliseconds (omitting the check for the event type, but this should be added into the condition as well... assuming here it;s about internal event)

date:<([entry.date.add(2419200000)])

or

date:<([entry.date.timestamp] + 2419200000)

Where 2419200000 is 28 days in milliseconds (4 weeks)

 

Alex

Jane Smith November 27, 2023

Hi @Alex Medved _ConfiForms_ thanks for the welcome!

I'm having a bit of trouble seeing where I might be going wrong. I have a dropdown "eventtype" with:

1: Internal

2: External

When I set the Condition as 

eventtype:1 AND date:<([entry.date.add(2419200000)])

 it is rejecting event if the date is more than 4 weeks.

Alex Medved _ConfiForms_
Community Champion
November 27, 2023

I am sorry, the condition I shared previously is a bit wrong. Mistyped the reference to "today"

eventtype:1 AND date:<([entry._today.add(2419200000)])

 Alex

Jane Smith November 27, 2023

Thanks Alex! Looks like we're good to go. :) 

Jane Smith November 29, 2023

Hi @Alex Medved _ConfiForms_ a follow up question... we've changed things up a bit. Instead, we've added another field "status" with the dropdown option. Instead of rejecting submissions, we'd still like to intake them but automatically set status to "declined" (which I've seen has the constant 'error'); otherwise, all status should be pending.

I am unsure of where I am going wrong with this setting as status does not have any values regardless of options being chosen.

eventtype:1 AND date:<([entry._today.add(2419200000)])

Action to execute *

Set value

Values to set

status=error
Alex Medved _ConfiForms_
Community Champion
November 30, 2023

You will need to set the first parameter in macro to track the eventtype and date fields for changes

eventtype,date

Alternatively (and for the logic to work on the backend and even when the form is used through the APIs you may consider switching this logic to a post function / ConfiForms IFTTT - https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-Create(Update)ConfiFormsEntry)

Alex

Jane Smith December 4, 2023

Hi @Alex Medved _ConfiForms_ can you clarify what you mean by setting the first parameter? I thought I did do that; this is all in the same macro correct?

Also, I have tried to IFTTT route, but I am also unsure of where I am going wrong. Can I set multiple IFTTT rules depending on the event type?

Event

onCreated

Choose Action to perform

Create/Update Confiforms Entry

Fire IFTTT action only when this condition/filter is met

eventtype:1 AND date:<([entry._today.add(604800000)])

Parameters to set on the entry

status=error
Jane Smith December 4, 2023

@Alex Medved _ConfiForms_ I think I might've figured out the IFTTT problem... I should've had:

Parameters to set on the entry

entryId=[entry.id]&status=error

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events