Compare to tables before "Add a new row to another table using values from this row." action

 

I have two main sources, a company table and database. I have created an action โ€œusing the Add a new row to another table using values from this row." to transfer companies from the table to the db if the Transfer status of the company is True (Checkbox).

I need to add a check between the two tables to make sure that a row doesn't get copied twice with two different unique IDs.

When a company is added to the DB then it gets another Unique ID (PID#), I need to add a check if the company already has a PID# before trying to add it.

Also, if possible, I would like it to update rows between the two tables if it already exists.

  • Company Table Key:  Infogroup ID#
  • Company Table Label: Company Name
  • DB Table: PID#
  • DB Label: Company Name
  • 1st Condition:Transfer Column =True
  • 2nd Condition: PID ISBLANK

Using this QA Response , which I think is part of what I'm trying to achieve, I used the expression below in the actions behavior area, but got this error " The expression is valid but its result type 'List' is not one of the expected types: Yes/No".

So, not sure where to put this exactly, if this is what I need to do.

SELECT(
  DA_RAW[InfoGroup ID#],
  AND(
    ([Transferred] = [_THISROW].[Transferred]),
    (
      [_ROWNUMBER]
      = MIN(
        SELECT(
          DA_RAW[_ROWNUMBER],
          AND(
            ([Transferred] = [_THISROW-1].[Transferred]),
            ([PID#] = [_THISROW-1].[PID#])
          )
        )
      )
    )
  )
)

 

Any help or direction is greatly appreciated.

0 2 104
2 REPLIES 2

As the error message says, SELECT returns a list but you need an expression that returns a yes\no valu.

You may want to enclose the SELECT with ISBLANK or ISNOTBLANK (I have not checked your logic so you may need yet another function that returns a yes/no)

So far it looks like that the Appsheet databases can't reference appsheet tables to make this verification happen. I can only move data between the two, with the action I already created. 

Top Labels in this Space