1

Automatically Extract the Month in a Text Field From a Date Field in Kissflow Forms

Would you like to retrieve the month from a date field and display it in a text field?
You can compute this with a simple formula. 

How does it work? 
Sarah, as part of her responsibilities, needs to approve leave requests for her team and conduct quarterly leave data analysis. To facilitate this analysis, she extracts the month from a date field and displays it in a text field using a formula. This allows Sarah to effectively analyze the data and make informed decisions based on monthly reports.

Imagine a form with a date field, Request Date, that auto-populates the date using the 'created' function. To extract the month from this date field and display it in a text field, you can use the following formula:

if(Requested_Date.month() = 1, "Jan",
if(Requested_Date.month() = 2, "Feb",
if(Requested_Date.month() = 3, "Mar",
if(Requested_Date.month() = 4, "Apr",
if(Requested_Date.month() = 5, "May",
if(Requested_Date.month() = 6, "Jun",
if(Requested_Date.month() = 7, "Jul",
if(Requested_Date.month() = 8, "Aug",
if(Requested_Date.month() = 9, "Sep",
if(Requested_Date.month() = 10, "Oct",
if(Requested_Date.month() = 11, "Nov",
if(Requested_Date.month() = 12, "Dec", ""))))))))))))

This formula efficiently extracts the month from the date field and displays it in a human-readable format, enabling Sarah to conduct her analysis effectively.

 

You can also use this formula with date fields where the date is manually input. 

Pro Tip: You can set a default date for a field to show when the form initially loads using this handy formula: date(_created_at.year(), _created_at.month(), _created_at.day())

Read more about the date field here

 suggested a use case for extracting the month from a date field. We now use this simple formula in forms where extracting the month from a date field is necessary. This has proven particularly useful for creating reports that include date and month data.

Content aside

  • 1 Likes
  • 2 wk agoLast active
  • 5Replies
  • 55Views
  • 4 Following