Reference previous thing field when changing another one

Hi all, sorry if has been answered or I am missing a basic thing but was unable to find a solution in the forum and the docs.

I am updating a list with monthly entries of NewUsers and TotalUsers by using a “Make changes to a list of things…” Workflow. I only have the NewUsers as an input and hence need to calculate the subsequent TotalUsers based on their previous Total Users (+ this months NetUsers). I can’t find an easy solution to this, for example referencing the most recently changed item in the workflow etc. Any idea in whats the most efficient way to achieve this?

To illustrate: How do I achieve the orange arrow when I change a set of things?

Have a field in your database of type number - I’d recommend a new datatype for this, like ‘User Count’ and the field could be called ‘User Total’. You can pre-populate this field with the current known number of users.

Then, in your workflow described above, add an additional step near the end, Make Changes to Thing → thing to change: User Count → field to change: User Total. The calculation would then be something like ‘User Count’s User Total + result of step (whatever step in your workflow is calculating the new users count).’

This should effectively allow you to add that new subtotal to the already established Total.

I use a similar technique when counting new ‘Likes’ on my app.

Why not just do a search for users grouped by month?

  • do a search for users grouped by month
  • display groupings in RG
  • inside each grouping Do a search for Users where created date < grouping’s date

Probably more WU efficient than creating a counter even with a search for each month. You can likely optimise further by returning all of the Users to the page and then filtering that list of users by created date so you’re not doing a search for every cell in the RG.

Thanks both. The problem is that the list contains numbers of users predicted over a period of multiple years (it’s a forecasting tool). So those users are just a number and not stored in a DB I could do a count on.

That also means if the assumption of net new users per month is changes, I need to iterate through the list and update 36 or even 60 lines per type of user (and there could be multiple). Therefore, I would either use a loop (which from all I understand is complex to set up with API Workflows and WU intensive). Or I was hoping to use the “Make changes to a list of things” workflow which works fine for changing net new users but not total users since I can’t find a way to access the previously changed things data.

I feel like this must be a common use case with a relatively straightforward solution but I might be wrong :sweat_smile:

1 Like

Hey @Gee ,
Not sure if this is best way but I was able to setup your use case with the help of RG Extractor plugin. Note, there is a free alternative plugin for the same, that should work as well :

Here is how I did it.
Firstly setup the plugin elements, RG Extractor element inside the RG and RG Data element for capturing the information from RG cells. Then inside RG add a new hidden input that will have default value set as current cell index - 1 , this input will be referred to get previous cells index.

Now in “Input Total Users”, keep the default value as “Input New Users” value and add a condition “When current cell index > 1” then Initial content as below:

This should give you desired result