Webhook Iteration Count?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
Is there any way to keep track of the number of iterations when running a repeat section in a webhook? I have a number of records that can be added with a grid edit so there may be multiple records created at once. When they are created, I am trying to create a webhook that will give each a different number in a particular field but the numbers cannot be unique to the table because the records are child to a parent table and the numbers for each child belonging to a parent will be independent of children belonging to other parent records. As an example, if a user added two records in grid edit, one needs a "1" in the field and the second needs a "2" in the field. If I can track iteration numbers in a webhook repeat, then this would be simple but I cannot figure out how to do so. If I cannot do that, any suggestions? Thanks!
Photo of rhuffman

rhuffman

  • 328 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Harrison Hersch2

Harrison Hersch2

  • 400 Points 250 badge 2x thumb
Is the entire purpose of this webhook just to do these counts?
Photo of rhuffman

rhuffman

  • 328 Points 250 badge 2x thumb
The purpose is to set the number fields in all newly created records, yes. I realize it probably sounds like an overly complicated way to achieve something so simple but I am designing this site in an attempt to mirror functionality of an old site as closely as possible (at least for the time being) to assist users with the transition period. This is a result of that but I am open to other suggestions as well.
Photo of Harrison Hersch2

Harrison Hersch2

  • 400 Points 250 badge 2x thumb
Do you need to handle deletions of records as well? One solution is just a summary field of "# of records" on the parent, pass it down as a lookup and snapshot it. Then have a formula that does snapshot + 1.
Photo of rhuffman

rhuffman

  • 328 Points 250 badge 2x thumb
There is no need to deal with deletions in this process. It's difficult to determine how multiple records added through grid edit are handled by the system but when I do it this way, all of the numbers end up being the same (2). It seems like all grid edit records are created at the same time, as with a API_ImportFromCSV so at the time of the snapshot, all lookups are equal to 1 (adding one to that leads to the 2 I am seeing).