I have a button on the canvas that adds a new row to the table below (at least that is what I want it to do). I have it set to filter the table first to find the max([End]) date and then use FormulaMap() to add a row and update values in that row from the filtered row. It works, except that rather than making one row, it’s making as many new rows as there are in the table. I believe I need to use sequence() to limit it to one row, but I can’t figure out where to insert it into the overall formula.
I’m not sure if I fully understand, so I duplicated the page and modified the formula. The FormulaMap or ForEach functions are typically used to iterate over all elements in a list or table. However, what you seem to want is to filter and retrieve only the last row, sorted by the end date.
I used the WithName function to keep the code cleaner. The formula DB SEO.sort(true, End).Last() sorts the rows of the DB SEO table by the end date in ascending order, and with the Last() function, it retrieves the last row, which is the most recent one. The rest of the formula is basically the same as what you had, I just adjusted the fields to retrieve the data from the result of the WithName formula.
Any questions, feel free to ask. And if it is not what do you are trying to do, we can discuss a little bit more.
To enable editing, you need to add the RunActions() formula along with the AddRow() function and call the OpenRow() function. To open the correct row, you can either use the same method as in the WithName section or simply retrieve the last row. The default sorting is based on RowID, which is unique for each row and increments automatically with every new row…