--- type: "fhirpath-operator" title: "FHIRPath Operator: in (in)" operator: "in" category: "Collections" section: "6.4.2" source: "fhirpath/operations.json" --- # FHIRPath Operator: in (in) If the left operand is a collection with a single item, this operator returns `true` if the item is in the right operand using equality semantics. If the left-hand side of the operator is empty, the result is empty, if the right-hand side is empty, the result is `false`. If the left operand has multiple items, an exception is thrown. The following example returns `true` if `'Joe'` is in the list of given names for the Patient: ``` fhirpath 'Joe' in Patient.name.given ``` ## Summary - **Category**: Collections - **Section**: `6.4.2` - **Left Argument**: `Any` - **Right Argument**: `collection` - **Return Type**: `Boolean` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description Returns `true` if the item in the left operand (single item collection) is in the right operand using equality semantics. If the left-hand side is empty, the result is empty; if the right-hand side is empty, the result is `false`. Throws an exception if the left operand has multiple items. ## Type Mapping - `Any-collection`