Hi Felix,
selected_roleid isn’t always populated in the response - it depends on whether the user selected a role or not, which in turn depends on whether you specify the selectedrole scope.
For details, see https://digital.nhs.uk/services/care-identity-service/applications-and-services/cis2-authentication/integrate/design-and-build/role-selection.