IN operator on expression

Hi All

How to use IN operator on the expression?

I want to do something like below

If(GetList.List.Current.Instruction.FMSBusinessUnitId=IntegerToIdentifier(1), (GetInstructionClaimStatus(GetList.List.Current.ClaimStatusChangeRequest.InstructionClaimStatusToId ).InstructionClaimStatus.Label IN ("Repudiated","WIthdrawn")),GetInstructionClaimStatus(GetList.List.Current.ClaimStatusChangeRequest.InstructionClaimStatusToId).InstructionClaimStatus.Label )

Thank you.


You're welcome.


If this worked for you, Please mark it as solution to help those other Outsystems fans when they have a similar problem ;)

Hi Thandeka,

Do you want to check if Label is "Repudiated" with "in" operator?

If so, you can use this: 

If(Index(GetInstructionClaimStatus(GetList.List.Current.ClaimStatusChangeRequest.InstructionClaimStatusToId ).InstructionClaimStatus.Label,"Repudiated") > -1 ,"Repudiated","WIthdrawn")

This means, If there is "Repudiated" in the Label, it says "Repudiated". Otherwise it says "WIthdrawn".


Best regards,

Yusuf Kerim


yes I want to check if the label is "Repudiated" or "Withdrawn" using IN operator

Okay You can use the index structure I wrote above instead of the IN operator.

thank you so much it's working but if I add another check , it doesn't allow me. Can you please assist on that , like checking if the label is "Repudiated","Withdrawn" , "Cancelled"

What condition exactly do you want?

What values can come in the Label value?

I want to check based on the selection done  on department dropdown then the relevant claim status should be applied on the "To Claim Status " on the table .  Example if Department is Repudiations then on the "To Claim Status" it should only display "Repudiated" or "Withdrawn". Please find attached screen shot

Example.PNG

Is the Label that you check a text? 

If so you can create an action and create your own logic in it.

You can set it as a function and use it like;

GetStatusLabel(GetInstructionClaimStatus(GetList.List.Current.ClaimStatusChangeRequest.InstructionClaimStatusToId ).InstructionClaimStatus.Label)

This will give you the value you set.

Best regards


You're welcome.


If this worked for you, Please mark it as solution to help those other Outsystems fans when they have a similar problem ;)

First advise would be to create a function, because this will be hard to maintain if you create this in an expression.

Then there are 2 options:

Either you have a list with the items Repudiated and Withdrawn. then use the listfilter.

If you have it in a string: 

"Repudiated,WIthdrawn" then use the index() functions to check.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.