Convert principalId to String