Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to add a filter that will only show items with a due date within the next 14 days?

Dena Ahlers
Contributor
February 5, 2024

I have a page created in Confluence but uses Macros from ConfiForms as well.  We would like to display only items due within 14 days.  Can anyone help with how this could be accomplished (if it can be).  

Thank you in advance for any help,

Dena

1 answer

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2024 edited

Hi @Dena Ahlers 

You can use the following filter (assuming the field to store dates is named "due"... but you can adjust accordingly)

due:>=[entry._today] AND due:<=([entry._today]+1209600000)

where 1209600000 is 14 days in milliseconds

Alex

Dena Ahlers
Contributor
February 5, 2024

Thanks Alex!!

Dena Ahlers
Contributor
February 5, 2024

Another question if you don't mind, I have this set up currently with a ConfiForms Field Definition (attached) Would I need to create a Rule definition to apply the filter or is there somewhere else it should be applied?

Thank you!

Screenshot 2024-02-05 at 11.54.16 AM.png

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2024

Was your question about the date field itself? About removing other dates from the date picker?

Dena Ahlers
Contributor
February 5, 2024

I'm wondering where I would use the filter you provided.  If I would need to create a different field type and where I would be entering the filter itself? 

Is that part of this Macro or would I be using a different macro? or use the macro along with a rule with the filter you provided?  Trying to figure out what is the best process.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2024

My understanding of this question was that you want to filter collected data by the due date and show only the rows that match this range

Dena Ahlers
Contributor
February 5, 2024

yup. but I am not sure where to put the filter that you provided.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2024

Every View macro in ConfiForms has this parameter, which you can use to specify a filtering expression

filter2apply.png

Dena Ahlers
Contributor
February 5, 2024

Got it!! thank you SOOOO much

 

Dena Ahlers
Contributor
February 5, 2024

I'm sorry @Alex Medved _ConfiForms_ can you help me with one last thing?  My field name is fnAAGduedate for the Due Date label. Would I then change the filter to 

fnAAGduedate:>=[entry._today] AND due:<=([entry._today]+1209600000)

I tried this but it did not return the right information so I am assuming I have it incorrect. 

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2024
fnAAGduedate:>=[entry._today] AND fnAAGduedate:<=([entry._today]+1209600000)
Dena Ahlers
Contributor
February 6, 2024

Thanks Alex, I did try that and it brings back all of the records, not just the records due in 14 days.  This is what I had to ensure I didn't miss something.
fnAAGduedate:>=[entry._today] AND fnAAGduedate:<=([entry._today]+1209600000)

If I change it to date:>=[entry._today] AND fnAAGduedate:<=([entry._today]+1209600000)

It returns 0 records, but I have at least 1 record that should meet the 14 day criteria.  Do I need a today's date field?  Thank you again for your help.  If you need any other screenshots please let me know.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2024

Why do you want to change anything in this expression!?

I dont understand

If you have a fnAAGduedate that has a value within 14 days from today then you should see a record  in the view.

Alex

Dena Ahlers
Contributor
February 6, 2024

I don't necessarily want to change anything, I just want the right information to appear.  Right now it shows all items from months ago to future due dates.  I only want it to show items that are due within 14 days from the day they are looking at the page.  I'm assuming I am missing something.

You originally said to use this 

due:>=[entry._today] AND due:<=([entry._today]+1209600000)

Unfortunately this brings up 0 results.

When I added the field name, then it brought up all fields with due dates ranging from 11-1-23 to 02-09-24

fnAAGduedate:>=[entry._today] AND fnAAGduedate:<=([entry._today]+1209600000) 

I'm trying to figure out how to get this expression to work with how the page is configured.  I'm wondering if it is confused on how the date is set up yy/mm/dd or if it needs an additional date field added.  I'm sorry I don't know enough about Confluence to understand the best way to get this to work. 

I attached a screenshot of how the date is displayed.Screenshot 2024-02-06 at 9.57.31 AM.png

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2024

BTW, the date format yy/mm/dd means you have

YEAR MINUTES DAY

 

Why I have said "due" for the due date, is beacuase I had no idea how the field is named in your form... 

That is why I have said

(assuming the field to store dates is named "due"... but you can adjust accordingly)

 

Demo:

http://recordit.co/BYcxTUJr7y

 

Complete example:

<ac:structured-macro ac:macro-id="56e68d64-c768-4d28-a8a7-b0d572101355" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="3a2dbf1a-67a6-47c0-a959-2522a6c0a2b2" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="b83f0a1f-ebe3-4fdd-bb5d-40046697575d" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">t</ac:parameter>
<ac:parameter ac:name="fieldLabel">t</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="fa44c7ce-79da-44fc-a3be-afca2cd66e13" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">fnAAGduedate</ac:parameter>
<ac:parameter ac:name="fieldLabel">fnAAGduedate</ac:parameter>
<ac:parameter ac:name="type">date</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<h1>ALL</h1>
<ac:structured-macro ac:macro-id="fba09d71-8154-4682-8253-affa45299934" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<h1>FILTERED </h1>
<p>as per <a class="" href="https://community.atlassian.com/t5/Confluence-questions/Is-it-possible-to-add-a-filter-that-will-only-show-items-with-a/qaq-p/2599072?utm_campaign=&amp;utm_content=post&amp;utm_medium=email&amp;utm_source=atlcomm#M291259">https://community.atlassian.com/t5/Confluence-questions/Is-it-possible-to-add-a-filter-that-will-only-show-items-with-a/qaq-p/2599072?utm_campaign=&amp;utm_content=post&amp;utm_medium=email&amp;utm_source=atlcomm#M291259</a>
</p>
<ac:structured-macro ac:macro-id="9dd9f791-858a-4244-ae24-a97e26d883a5" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="filter">fnAAGduedate:&gt;=[entry._today] AND fnAAGduedate:&lt;=([entry._today]+1209600000) </ac:parameter>
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>

Hope it helps...

Alex

Dena Ahlers
Contributor
February 6, 2024

Thanks again Alex!

I found the issue I was having is that I am on an older version and 

[entry._today] doesn’t seem to be supported in our version. Changing that to [today] in the filter seemed to fix it

 

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2024

Oh, it must be some very very old version of ConfiForms then  :(

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community events, ace, engineering, confluence feed, power of feed, atlassian ask me anything, atlassian confluence answers, ace rsvp, atlassian community events rsvp, atlassian magic

“How We Built This” ft. Atlassian Confluence Engineers

Meet the engineers who are making the Confluence magic happen at Atlassian ✨

RSVP now!
AUG Leaders

Upcoming Confluence Events