reset month count dropdown every time year is changed

I want to reset value of dropdown for month according to current year like if it is going on November 2023 so it will only show date up to 17 Nov 2023 but if I select 2022 month should reset to December 31 how can I achieve this. In my case date is changing accordion to year and month but month is not getting refreshed according to year.

Hi @Vaibhavi Paranjpe ,
Are you showing date values in a dropdown or with a date picker component?

Hi @Anubhav Rai , I am showing date values in dropdown according to month. I am not using date picker component.

And how you are showing Months values? is it with OS default table or you have created it?

Then maintain the order attribute in it and make sure it is accurate as per the month sequence and apply this condition in the filter
If(year= Year(CurrDateTime()) and Month(CurrDateTime())<12,order<=Month(CurrDateTime()),True)

"year" will be a local variable or the variable that is holding your year dropdown values.

Please let me know if you have more queries.


Thanks I'll apply this and will let you know if it works.

If for future years you don't want to show any month value then just replace the "True" from the false condition and put this 

"Year <  Year(CurrDateTime())"

And don't forget to refresh the month aggregate on the year dropdown value change.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.