A Research Study to Compare Two Types of Insulin, a New Weekly Insulin, Insulin Icodec and an Available Daily Insulin, Insulin Glargine, Both in Combination With Mealtime Insulin, in People With Type 2 Diabetes Who Use Daily Insulin and Mealtime Insulin (ONWARDS 4)

This study compares insulin icodec (a new insulin taken once a week) to insulin glargine (an insulin taken once daily which is already available on the market) in people with type 2 diabetes.

The study will look at how well insulin icodec taken weekly controls blood sugar compared to insulin glargine taken daily.

Participants will either get insulin icodec that participants will have to inject once a week on the same day of the week or insulin glargine that participants will have to inject once a day at the same time every day. Which treatment participants will get is decided by chance. Participants will also get a mealtime insulin.The insulin is injected with a needle in a skin fold in the thigh, upper arm or stomach.

The study will last for about 8 months. participants will have 17 clinic visits and 13 phone calls with the study doctor.At 8 clinic visits participants will have blood samples taken. At 4 clinic visits participants cannot eat or drink (except for water) for 8 hours before the visit. Participants will be asked to wear a sensor that measures their blood sugar all the time in 3 periods for a total of 13 weeks (about 3 months) during the study.

Women cannot take part if pregnant, breast-feeding or plan to become pregnant during the study period.


Eligibility Criteria:
Inclusion Criteria:

* Male or female aged above or equal to 18 years at the time of signing informed consent.
* Diagnosed with type 2 diabetes mellitus (T2D) greater than or equal to 180 days prior to the day of screening.
* Glycated haemoglobin (HbA1c) from 7.0-10.0% (53.0 85.8 mmol/mol) both inclusive at screening confirmed by central laboratory analysis.
* Treated with once daily basal insulin (neutral protamine hagedorn insulin, insulin degludec, insulin detemir, insulin glargine 100 units/mL, or insulin glargine 300 units/mL) and 2-4 daily injections of bolus insulin analog (insulin aspart, faster acting insulin aspart, insulin lispro, insulin glulisine) greater than or equal to 90 days prior to the day of screening with or without any of the following anti-diabetic drugs/regimens with stable doses greater than or equal to 90 days prior to screening:

Metformin / Sulfonylureas / Meglitinides (glinides) / DPP-4 inhibitors / SGLT2 inhibitors / Thiazolidinediones / Alpha-glucosidase inhibitors / Oral combination products (for the allowed individual oral anti-diabetic drugs) / Oral or injectable GLP-1-receptor agonists

* Body mass index (BMI) below or equal to 40.0 kg/m\^2.

Exclusion Criteria:

* Any episodes (as declared by the subject or in the medical records.) of diabetic ketoacidosis within 90 days prior to the day of screening.
* Myocardial infarction, stroke, hospitalisation for unstable angina pectoris or transient ischaemic attack within 180 days prior to the day of screening.
* Chronic heart failure classified as being in New York Heart Association Class IV at screening.
* Anticipated initiation or change in concomitant medications (for more than 14 consecutive days) known to affect weight or glucose metabolism (e.g. treatment with orlistat, thyroid hormones, or corticosteroids).
* Uncontrolled and potentially unstable diabetic retinopathy or maculopathy. Verified by a fundus examination performed within the past 90 days prior to screening or in the period between screening and randomisation. Pharmacological pupil-dilation is a requirement unless using a digital fundus photography camera specified for non-dilated examination.