How do I combine these expressions?

I have these 2 expressions that each work independently but I can't figure out how to combine them into a single valid if expression

SELECT(T Sheets Export[Timesheet ID], [Contract/TM]=[_THISROW].[Type],
[TYPE]<>"Shop Maintenance"),

T Sheets Export[Timesheet ID]-Ticket details[tsheets id]-SPLIT(Ticket details[tsheets id enum] ,",")

This expression creates this error and references an IN function which isn't in the expression:

Column Name 'Tsheets ID Enum' in Schema 'Ticket Details_Schema' of Column Type 'EnumList' has an invalid data validation constraint '=SELECT(T Sheets Export[Timesheet ID], [Contract/TM]=[_THISROW].[Type], [TYPE]<>"Shop Maintenance"), T Sheets Export[Timesheet ID]-Ticket details[tsheets id]-SPLIT(Ticket details[tsheets id enum] ,",")'. IN function is used incorrectly

When I try combining with an AND Statement, I receive an error that states it must be a yes/no condition

AND(
SELECT(T Sheets Export[Timesheet ID], [Contract/TM]=[_THISROW].[Type],
[TYPE]<>"Shop Maintenance"),

T Sheets Export[Timesheet ID]-Ticket details[tsheets id]-SPLIT(Ticket details[tsheets id enum] ,",")
)

Error:

Condition AND(SELECT(T Sheets Export[Timesheet ID],([Contract/TM] = [_THISROW].[Type]),([TYPE] <> "Shop Maintenance")), ((T Sheets Export[Timesheet ID]-Ticket Details[TSheets Id])-SPLIT(Ticket Details[Tsheets ID Enum],","))) has an invalid structure: subexpressions must be Yes/No conditions

0 5 268
5 REPLIES 5

It is not exactly clear how you wish to combine those two lists. But you cannot AND() two lists.

Please try lists addition or lists subtraction based on your requirements. It sounds you would want to add the two lists ( or precisely three lists as you have one list getting subtracted from other) since you have mentioned you wish to combine them.

Combine lists - AppSheet Help

Please revert if you are trying to achieve something else.

 

My Goal is to have an enum list only showing unused items which was achieved by list subtraction. I would like to limit the items shown by a column type selected in a different column and to also exclude items by type which match certain words which I was able to achieve in the select statement. I don't know how to write this goal into a single expression. Or write it differently to achieve these results 

Thank you for the summarized requirement. You may want to share more details with respect to associated expressions , table column names etc. for a more definitive solution/suggestion, if so available from the community.

When a ticket is created, the user chooses the Type (enum) of work, the Project_ID (ref) and then Select Multiple Timesheet Entries (enum list from T Sheets Export[Timesheet ID])  to add to the ticket. 

ZOCO_Unlimited_2-1669566351436.png

When you Select Multiple Timesheet Entries, I would like to

  1. Limit the options to reflect only the options from the above Type and Project_ID
    1. SELECT(T Sheets Export[Timesheet ID], AND([Contract/TM]=[_THISROW].[Type],
      [Job/Customer ID]=[_THISROW].[Project_ID]))
  2. Only show entries that have not been selected before in other tickets
    1. current expression that works:   T Sheets Export[Timesheet ID]-Ticket details[tsheets id]-SPLIT(Ticket details[tsheets id enum] ,",")
      )

ZOCO_Unlimited_1-1669566316505.png

This expression works in the editor but when I save, I receive an error (below)

T Sheets Export[Timesheet ID]-Ticket details[tsheets id]-SPLIT(Ticket details[tsheets id enum] ,","), SELECT(T Sheets Export[Timesheet ID], AND([Contract/TM]=[_THISROW].[Type],[Job/Customer ID]=[_THISROW].[Project_ID])
)

ZOCO_Unlimited_4-1669572818326.png

 

ZOCO_Unlimited_5-1669572863400.png

 

List of Tables, Columns, Keys, Labels:

ZOCO_Unlimited_3-1669566690196.png

 

Thank you for all the details. I believe we may need more details, especially on column types. But to start with, you may wish to try the following expression  based on understanding so far. Please note it is an entire one expression with a subtract operator.

SELECT(T Sheets Export[Timesheet ID], AND([Contract/TM]=[_THISROW].[Type],
[Job/Customer ID]=[_THISROW].[Project_ID]))  -

SPLIT(SELECT( Ticket details[Tsheets id], AND([Type]=[_THISROW].[Type], [Project_ID]=[_THISROW].[Project ID])),",")

Top Labels in this Space