Set a value based on date?


hi bubblers need helps about setting a value based on date.

so i have a data called “CYCLE” (with value 1,2, and 3).
i want set when the user choose date for example “01 November 2022” until “20 November 2022” then the CYCLE value is 1.

how to achieve that?
for information i have database “start date” and “end date” with date value,
and the CYCLE in the option set.
should i add a date field in my option set?

thanks for the attention.

Hi there,… if I understand your post correctly, this condition on the Cycle dropdown should produce the desired result of the dropdown defaulting to a value of 1 when the End date field is any date up to and including the 20th of the month.

Hope this helps.


hi @mikeloc thanks for replying,

how if i want to set it on the workflow?
so i want it to set on the workflow when user hit button submit.
when the user submit project and the date is between 01 nov until 20 nov then the cycle is 1, is my data structure i mention above is ok?

If you do what I showed and you save the dropdown’s value to a field (which has a field type of the Cycle option set) when the submit button is clicked, you should be good to go.

thank you ill be try it out,
one last question mike if u dont mind, can i set it automaticly for other cycle?
like CYCLE 2 is when date is between 21 nov until 10 dec, i know it will be a long workflow, can i make it simple?

You can easily set the default value of the dropdown based on one or both of the dates in the date fields, and I showed you an example of how to do that. That being said, you need to clearly define when each option in the dropdown should be the default. I assumed you wanted the dropdown to default to a value of 1 any time the end date is less than the 21st in any month. Your follow-up question makes it clear that isn’t the case, and what you are describing now complicates things a bit. So, what are the exact date ranges from month to month when each option in the dropdown is supposed to be the default value?

sorry mike for confusing you, and not spesific explain, i’ve just try your way and its working fine, thank you for that.
so, what spesific date i want to set is like CYCLE 1 (01 Nov 2022 - 20 Nov 2022), CYCLE 2 (21 Nov - 10 Dec 2022), CYCLE 3 (15 Dec 2022 - 15 Jan 2023).

1 Like

Here is an example of the condition for cycle 1, with the start date’s arbitrary date being October 31, 2022 and the end date’s arbitrary date being November 21, 2022.

You would need to add two more conditions for the other date ranges, of course.

1 Like

Thank you a lot @mikeloc it works like i want. sorry for the trouble before.

Big Big Thank you.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.