Programmatically setting value in Select2 with AJAX data retrieval when minimum input length is defined

I have a select2 which is defined with minimum input length and ajax call (remote data) to retrieve data from server based on user input.

    minimumInputLength: 3,
    ajax: {
        // AJAX configuration here

When a user selecting a previously saved record to update, I need to set the option programmatically so the user can see it and if needed, can change. I have tried setting the value and also appending as a new option, but nothing seems to work.

Attempt 1 :


Attempt 2:

var option = new Option(text, value, true, true);

Also tried this

Attempt 3:

     url: link,
     dataType: "json",
     type: "GET",
     contentType: 'application/json; charset=utf-8',
     async: false,
     processData: false,
     cache: false
}).then(function (data) {

    // create the option and append to Select2
    var option = new Option(text, value, true, true);

    // manually trigger the `select2:select` event
        type: 'select2:select',
        params: {
            data: data

Nothing seems to work.

Any help would be highly appreciated! Thank you in advance.