Skip to main content
July 29, 2024
Question

Result of wherecontain() changed in if()

  • July 29, 2024
  • 8 replies
  • 0 views

Weird thing happened, I have a if() function

if(
    my condition,
    value when true,
    remove(local!myList, wherecontains(cons!code, local!myList.code))
)

when I take the remove() out of if(), it's result is a list of 4 items, but in if(), it's result is a list of 1 item

And I tried with wherecontains(), when it's a standalone out of if(), the result is List of Number (Integer) - 0 items, but in if() the result became 

But why would this remove 3 items from myList?

    8 replies

    sarathkumr268295
    July 29, 2024

    Can you provide more details like what are the values that are present in the variables which you mentioned.

    July 30, 2024

    1. When wherecontains() in if(), and condition value is false

    2. When where contains() not in if()

    3. Value when true in if(), not used in this case anyway

    4. Combined with remove() - expected value

    5. When it's in if(), the remove() result is not correct

    In if() condition my colleague added a condition, see commented out lines, and it worked. But I can't see why the added condition change the result because condition 1 is false anyway

    sarathkumr268295
    July 30, 2024

    Can you provide a screenshot of the values which are present in the local variables?

    rajt0005
    July 29, 2024

    can you pls provide the screenshot of the rule with value