cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Count inside a form?

So I'm new to Nintex.  I've used mostly Infopath but am now being forced to change.  It looks like Nintex may have some capabilities that IP did not.  Here's what I'd like, and I'm hoping someone can tell me if this is possible.

 

I'm building a simple list with dates, numerical values (representing hours), and an option for AM/PM

My view is only going to show the current day, based on the date entry in the list.  Ideally I'd like to have a total value of hours available for each day, and requests pull those hours out of the bucket.

 

Since it's possible to place a calculated field in the form, is it possible to have it dynamically calculate the total hours value for the day?

 

Lets say my bucket for 01/15 is 16 hours AM and 24 hours PM, and my list looks like this:

 

Employee     Date       Hours     AM/PM

Dale              01/15      8             AM

Harry             01/15      8             AM

Hank              01/15     8             PM

 

....would it be possible when you go to enter a new item, the form would calculate and show available AM hours as 0 and PM hours as 16?  This is assuming there are more list items hidden because of the view parameters.

 

Thanks for taking a look, anyone who reads this.

Labels: (1)
0 Kudos
Reply
1 Reply
Highlighted
Nintex Employee
Nintex Employee

Re: Count inside a form?

I assume that your intention is to have a form for the end users to fill out, with the form indicating the number of hours available for the respective date and AM/PM slot.
There may be a way to use a single list but the way that I went about this situation was by using two different lists. The example of the two lists were as follow:

(1st list) HourRequest
Employee      Date      Hours      AM/PM
Dale           01/15          8            AM
Harry          01/15         8            AM
Hank          01/15          8            PM

(2nd list) HourAvailable
Date      AM Pool      PM Pool
01/15      16                24
01/16      16                24
01/17      16                24
01/18      16                24

The end user can select a date as well as a choice between AM/PM. The intention is to update the hour pool after the form has been submitted. It would suggest to me that you’d need to refer to a separate list since the output is referring to a unique date with a value.


In doing so, complicates how you retrieve that information in the form that is in the HourRequest list. One way that I was able to achieve this was by utilizing Item Lookup as seen below:

Item Lookup.png

 

You can also disable this field within the appearance tab. The result is a value that is listed on the form when the end user selects a particular date.

 

The next step is populating the new AM/PM pool based off the end user's hours requested. For this we will need to create a workflow that initiates based off item creation. If you set your math operations to calculate the new value, you can then use update item to apply the changes to the pools for the specified date.

 

One thing I didn’t address was determining how to apply the hours requested to the chosen pool. Instead of writing out the logic, what I did instead was created duplicate fields that were rule dependent on the AM/PM choice in Nintex Forms. Apply the math operation on both pools within the Workflow. What should happen is the end user selects AM or PM and a field opens that is either AM hour requested, or PM hour requested. The field that remains hidden has a default value of 0 so this allow the workflow to apply the two update items for both AM and PM pools, no matter what the end user inputs.

 

I’d venture to guess that you want the end user to be unable to make a request that puts the hours requested beyond the AM/PM hour pool. I think what you would be able to do is make a rule on the submit button within your Forms based off the hour requested pool and the displayed Item Lookup.   

 

Lastly, my only curiosity for this is what the business use of this would be. Depending on your end use, it can either further simplify or complicate the design. 

 

Hope this helps!

0 Kudos
Reply