--- type: "fhirpath-function" title: "FHIRPath Function: last" function: "last" category: "Subsetting" section: "5.3.4" source: "fhirpath/functions.json" --- # FHIRPath Function: last Returns a collection containing only the last item in the input collection. Will return an empty collection if the input collection has no items. ## Summary - **Category**: Subsetting - **Section**: `5.3.4` - **Return Type**: `collection` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `false` ## Description Returns a collection containing only the last item in the input collection. ## Arguments - none ## Type Mapping - `Any-Any` ## Example ```fhirpath Patient.name.last() // returns the last name element ```