Add values ​​from the last value of an attribute

Dear community!   Assuming I have an entity called counter with two attributes: count and user. In each record of this entity I must enter the user in a text box and the first count value will be 1, then for the second user I need a microflow that records 1 + 1 and automatically gives the number 2, pretending that I am going by user 50 and the next user would be 51, but at that moment I decide to reset the count attribute and I want it to start from 1 again, or from any value, I enter the value manually as 1, then the next record should be 2 and the next 3 and so on.   Please your help!
2 answers

Hi Cristhian,

For this what you can do is, you can add another attribute of autonumber in your entity,

While creating a new object, you can retrieve the object of the highest autonumber ( that will be the latest created record). And you can use it to get the number you want to have in your new object.

Let me know, if you have any issues,

Hope it helps!


"Hi Cristhian,

Yes, you can achieve it with the following steps:

  1. Create a non-persistable entity with a boolean attribute called IsReset.
  2. Create a page and add a data view that is connected to the non-persistable entity.
  3. Create a microflow that creates an object for the non-persistable entity and calls the previously created page.
  4. Inside the data view, you can have counter entity data ( where you can view or create your counter objects ) and a reset button on the page.
  5. When you click on reset, update the IsReset boolean to true. Based on this boolean, you can reset your count attribute in the counter entity when you add new data to that entity."