Find month using decision activity

0
Hi, I want to find month from dateTime in decision activity. For example I have a list that have been submitted in one year, I want to make a dashboard to sort the list by count the submission form by month. Can anyone suggest the correct code ?
asked
3 answers
4

Hi! 

The month-from-date-time option can indeed only be used within an xpath statement.
To get the month in a decsion you can use the Format Date time option, for example:
formatDateTime($yourdate, 'MM')

If you need it the be an integer you can add the parseinteger() function before this.

Hope this helps!

answered
3

You can use something like parseInt(formatDateTime($yourdate, 'MM')) to convert a date object in numerical month.

i would suggest you create a NP entity with Monthnumber[int] and noOfProject[int] and make a one to many association to project let call it MonthDataHOlder[MDH..]

now in ur microflow u can put a loop over project find it’s month number and create a MDH object and link the project to it.dont forget to add MDH to a list created outside the loop.

now once loop completes make sure u dont have duplicate MDH by checking in the list in each iteration before creation.

And after the completetion of the loop u can sort list of MDH based on nuberof Project attribute and return it to the list view

answered
1

Hi,

You could convert the date into day ,month or year by downloading the ‘community common’ module in your studio pro and use the java action CurrentMonth from community common in your microflow, and you will good to go.

answered