Iterate over data and change the value of a field until condition is not met anymore. - No more Code

I have discovered a new way using multiple actions to iterate over data and change the value of a field until a condition is not met anymore thus ending the batch process.

Requirement:  Update all stock quantity values from 0 to 1

One Model = StockDataModel

A) First set Model Actions:
2 Model Actions Settings for StockDataModel =

1st action = When Model Saved then run one action
Action = Query Model (Behavior = Standard, completely replace data)

2nd action = When Model re-queried then run 2 actions
Action = Update a field on row(s) field:Quantity value:1
Action = Save Model StockDataModel.

B) Create a Button (on Page Title) action type = multiple actions
1st action = Update a field on row(s) field:Quantity value:1
2nd action = Save Model StockDataMode
3rd action = Query Model (Behavior = Standard, completely replace data)

C) Set Model Condition:
field:Quantity is not = 1
condition set to = is always on

This way the update will be invoked when the user clicks on the button.
The multiple actions on the Model Actions kick in and begin to iterate over the data until the model condition is no longer met and there is no more data to display in the Model.

This can be used in many different ways including allowing the user to enter a value as to how many times this should happen, for example when creating x amount of Items, and filtering on the updated changing value of the user input (i.e. 10 = input value -1 for every update) when performing the updates to end the process.

Just loving Skuid Summer 14!!

 

er … uh … I kinda get it. Mostly don’t though. Can you provide an example page and/or video?

For this basic example I have created a custom object called Item with fields:

  1. Name (Primary)
  2. Quantity (Number 10,0)

The Page button changes the value from 0 to 1 and invokes the batch update.

Here is the XML.

















ItemsOne




models.loaded






ItemsOne
NewItems




models.saved
















{{Model.labelPlural}}


Home







ItemsOne




ItemsOne
NewItems