Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
7 subscribers
Views
1540 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
HI- We are working on an application where a user reserves inventory for certain
rachealv537
over 9 years ago
HI- We are working on an application where a user reserves inventory for certain events. The events can be over multiple dates. So, the inventory has to be reserved for each day of the event.
Our form has a begin date and an end date. I would like to retrieve the actual dates between and including the beginning date and the end date. The next step is to reserve the inventory for all of these dates. I do not want the user to have to enter every date individually.
Is there a rule or function that already exists to accomplish this? If not, any advice on the best way to accomplish this? Thanks....
OriginalPostID-128100
OriginalPostID-128100
Discussion posts and replies are publicly visible
Parents
0
Mike James
Certified Lead Developer
over 9 years ago
Hi - I created an expression rule to add days to your start date.
rule!startDatePlusDay" =ri!startdate+ri!day
then a second expression to iterate over the first one for the number of days needed.
rule!createDateArray =apply(rule!startDatePlusDay,enumerate(tointeger(ri!enddate-ri!startdate)+1),ri!startdate)
with input start of "11/42014" and end date of "11/10/2014" the output is:
{11/4/2014, 11/5/2014, 11/6/2014, 11/7/2014, 11/8/2014, 11/9/2014, 11/10/2014}
Hope that helps!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Mike James
Certified Lead Developer
over 9 years ago
Hi - I created an expression rule to add days to your start date.
rule!startDatePlusDay" =ri!startdate+ri!day
then a second expression to iterate over the first one for the number of days needed.
rule!createDateArray =apply(rule!startDatePlusDay,enumerate(tointeger(ri!enddate-ri!startdate)+1),ri!startdate)
with input start of "11/42014" and end date of "11/10/2014" the output is:
{11/4/2014, 11/5/2014, 11/6/2014, 11/7/2014, 11/8/2014, 11/9/2014, 11/10/2014}
Hope that helps!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data