Copy and Delete a Row from one table based on a value from another.

I'm probably over-complicating this, and not explaining properly. 

There is a data set - table 2, that users need to request amendments to a SKU, rather than amend directly. Table 1 holds these requests. When a request is approved - I can get Appsheet to move (through copies and deletes) the line from table 1 to table 2 (and a request archive). Fine. 

I also need it to find the existing record in table 2 based on the SKU of the request that's moving. It needs to copy and delete the line from table 2 to an archive table - table 3. 

Now from attempting, the movement actions aren't the issue, so much as just not identifying the existing line with the SKU from the request.

The only other option I can think of, which I've not attempted but need to work out how to do is: a schedule bot runs regularly and checks table 2 for duplicates. If it finds a duplicate line, it takes the oldest line (there is a date added field) and moves it off. 

0 2 135
2 REPLIES 2

It's a little bit hard to clearly get what your setup is. Please explain with real examples what you have done and the fields that are involved, as well as your table's schema

Steve
Platinum 4
Platinum 4

@Nikky0x wrote:

The only other option I can think of, which I've not attempted but need to work out how to do is: a schedule bot runs regularly and checks table 2 for duplicates. If it finds a duplicate line, it takes the oldest line (there is a date added field) and moves it off.


TOP(
  ORDERBY(
    FILTER(...),
    [date],
      FALSE
  ),
  1
)
  1. FILTER(...) finds all rows for the desired SKU.

  2. ORDERBY(..., [date], FALSE) sorts the rows from (1) (...) by their date column value ([date]) in ascending order (per FALSE), so that the oldest row is first and the newest is last.

  3. TOP(..., 1) gives a list containing only the first (1) row from (2) (...).

FILTER() - AppSheet Help

ORDERBY() - AppSheet Help

TOP() - AppSheet Help

Top Labels in this Space