Set a date based on a Quarter and Year
Here is how you can use the Custom JavaScript pipe > Moment.js call to set a date field based on what Quarter and Year are set and use that to update a Status field.
Step 1
Install the Custom JavaScript pipe. Within the API Calls of the pipe, set up the parameters as shown in the image below.
Step 2
Within the Request tab of the API calls, add the following code.
var outputDate;
if ('{quarter}' === 'Q1') {
outputDate = moment('{year}-03-31').format('L');
} else if ('{quarter}' === 'Q2') {
outputDate = moment('{year}-06-30').format('L');
} else if ('{quarter}' === 'Q3') {
outputDate = moment('{year}-09-30').format('L');
} else {
outputDate = moment('{year}-12-31').format('L');
}
outputDate
Step 3
Set the following table rules when a record is "created or edited."
#1
#2
#3
Original Community Post:
Set a date based on a Quarter and Year - Community Discussions / Pipes - Tadabase Community
We'd love to hear your feedback.