cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Nintex subtract the amount.

I am having a list where users can request certain amount either full or in 2 installment, can Nintex read from same list if user has request any amount and only allow him to use subtract amount.

For example, all user are allowed to request 100, if user has requested 50 first then its only allowed to request 50, if user request 100 then he will not be allowed to request any amount.

Labels: (1)
0 Kudos
Reply
8 Replies
Workflow Hero

Re: Nintex subtract the amount.

Hi Rizwan,

Do you want to validate that in the Form or in a Workflow?

Regards,

Christophe

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Nintex subtract the amount.

it would be great if its validate in form but fine to have even in workflow, then workflow can send message to user that request can't be proceed due to amount, please re-request. user's can be monitor by their login ID (person and group).

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Nintex subtract the amount.

So the easiest way then: a Workflow

You need three steps:

1. A Query List action

2. A loop to sum the retrieved amounts for the initiator (user)

3. You test the sum again your allowed amount

1. Query List

For the Query part of the action: Keep Query Builder

For Fields: This is the name of the column containing the Amount

For Filters,

For Show the items when column, enter the name of the column containing the Employee name

Keep is equal to

Then select on the right, under Workflow Context, if this is for the initiator of the request, Initiator Display Name

For First Column, create a Collection variable: collAmount

2. Use a For Each loop in which you insert a Do Calculation to sum the content of collAmount

3. You use a If Action to test the sum again your allowed amount

Hope it helps,

Regards,

Christophe Raucq

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Nintex subtract the amount.

Christophe provides a great approach, for a completely different option that is just to share some ideas, you could have a list with a few fields (Title, Amount - as number or currency, user - as person). In one item have the values of ("Total", 100, {blank}). Then create a Nintex Form for the list and put this form on a home page using the Nintex Form webpart for Lists and have it show the New form.

In the list form, Have a lookup to the same list filtering by Title equals to "Total" - and it can be disabled. Then have another single line of text control for the user to enter their amount. Add a Rule for validation to show an error message if the users amount is greater than the Total amount.

When the user submits a successful response, have a workflow update the item Total by subtracting the amount the user just entered. The workflow can also change the current item (users submission) Title field to the users display name and insert the initiators login name to the person field to help query later.

So the user doesn't necessarily have to interact with the list, just the form on the page to make submissions.

I can think of several ways to improve on this idea, but just wanted to share the many ways to look at the problem.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Nintex subtract the amount.

seems i am missing something , i am sharing the screenshots please correct me , as suggested i have create the query builder with all details, in second screenshot i add the variable, can you see the last screenshot i am not able to pick any thing "store result in" as its blank.

Capture1.PNG

Capture2.PNG

Capture3.PNG

Capture4.PNG

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Nintex subtract the amount.

If the CollAmount collection variable is a collection of single line of text values, then the Store Result in is looking for a variable of type single line of text.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Nintex subtract the amount.

Hi,

intAmount is integer

intIndex is integer

If collAmount contains 50 and 25

For Each will run 2 times and intAmount will contain 50 the first time and 25 the second time

Capture.PNG

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Nintex subtract the amount.

He's exactly right! Rizwan, does this help? Were you able to get the result you wanted?

0 Kudos
Accept as Solution Reply