Add Row Action Failing due to Valid If - Help with Expression

I’m using the action: “add a row to another table using values from this table” and the record is failing due to the Valid If statement. In the case below, I have a record I’m trying to insert that has a Cart Weight of 2561. The expression should allow the record being inserted is function: SCALE_RECV. The expression seems to not recognize the function and enforces the validation. I could really use some help with the right expression.

The following is the Valid If Expression:

IFS(
[function]=“SCALE_RECV”,[_THIS]>0,
AND([function]=“WHSE_RECV”,[Cart Material].[name]=“Trash”),AND([_THIS]>0,[_THIS]<3000),
AND([function]=“WHSE_RECV”,[Cart Material].[name]=“Clothes”),AND([_THIS]>0,[_THIS]<1000),
TRUE,[_THIS]>0,
)

I also tried:

IFS(
CONTEXT(View)=“Scale Receiving Detail”,[_THIS]>0,
AND([receiving_id].[Function]=“WHSE_RECV”,[Cart Material].[name]=“Trash”),AND([_THIS]>0,[_THIS]<3000),
AND([receiving_id].[Function]=“WHSE_RECV”,[Cart Material].[name]=“Clothes”),AND([_THIS]>0,[_THIS]<1000),
TRUE,[_THIS]>0,
)

Here is the action that inserts the record.

ERROR REFERENCE:
“Errors”: “Error: Perform DataAction ‘create_scale_carts_clothes’ failed because Row having key ‘c311532a’ in table ‘Carts’ containing value ‘2940’ in field ‘Cart Weight’ failed ‘Valid_If’ condition. Error: Perform DataAction ‘create_scale_carts_clothes’ failed because Row having key ‘c311532a’ in table ‘Carts’ containing value ‘’ in field ‘Cart Barcode’ failed ‘Required_If’ condition. Error: ‘Add Row’ Data action ‘create_scale_carts_clothes’ failed with exception Collection was modified; enumeration operation may not execute. .”,

0 2 226
2 REPLIES 2

Steve
Platinum 4
Platinum 4

Does a Valid If expression of just TRUE work?

The Valid If is required if the record’s function = “WHSE_RECV”.

Just tried:

IF([function]=SCALE_RECV,FALSE,
IFS(
[Cart Material].[name]=“Trash”, AND([_THIS]>0,[_THIS]<3000),
[Cart Material].[name]=“Clothes”,AND([_THIS]>0,[_THIS]<1000),
)
)

And…
IF([function]=SCALE_RECV,FALSE,
IFS(
[Cart Material].[name]=“Trash”, AND([_THIS]>0,[_THIS]<3000),
[Cart Material].[name]=“Clothes”,AND([_THIS]>0,[_THIS]<1000),
)
)

Top Labels in this Space