Rest API not returning anything

Hi all... new to Syncfusion and yes, loving it.


I do have a problem that I just can't seem to figure out and need some help. I'm doing a simple (what seems simple to me) autocomplete using the web api with the webapiadapter. Here's the rub: I laid in the url and what I think or thought were the data elements but get absolutely nothing. Here's the url as you can see when you go to it in your browser it works fine: https://rxnav.nlm.nih.gov/REST/Prescribe/drugs.json?name=cymbalta

It's probably standing right in front of me looking right at me! Any help is most appreciated.


Thanks in advance,


J

------- Code --------

Snippet
@page "/autocomplete-features"
@using Syncfusion.Blazor
@using Syncfusion.Blazor.DropDowns
@using Syncfusion.Blazor.Data
<h2>AutoComplete</h2>
<br />
<div id="ControlRegion">
    <div class="control-section">
        <div id='remote-data'>
            <h4>Remote Data</h4>
            <SfAutoComplete TValue="string"
                            TItem="RxDetails"
                            Placeholder="Select a name"
                            Query="@RemoteDataQuery"
                            Autofill="true">
                <SfDataManager Url="https://rxnav.nlm.nih.gov/REST/Prescribe/drugs"
                               CrossDomain="true"
                               Adaptor="Syncfusion.Blazor.Adaptors.WebApiAdaptor">
 
                </SfDataManager>
                <AutoCompleteFieldSettings Text="name"
                                           Value="name">
                </AutoCompleteFieldSettings>
            </SfAutoComplete>
        </div>
    </div>
</div>
<label>Api example with results..</label> <a rel='nofollow' href="https://rxnav.nlm.nih.gov/REST/Prescribe/drugs?name=cymbalta" target="_blank">https://rxnav.nlm.nih.gov/REST/Prescribe/drugs?name=cymbalta</a>
 
 
<style>
    #remote-data {
        width35%;
        margin0 auto;
        padding3%;
    }
 
    .ulstyle {
        margin0px;
        padding-left20px;
        displayinline-block;
    }
 
    .list {
        floatleft;
        line-height20px;
        margin10px;
        min-width330px;
    }
</style>
 
 
@code{
    public Query RemoteDataQuery = new Query().From("drugGroup").Select(new List<string> { "name" }).Take(6).RequiresCount();
    public class RxDetails
    {
        public int? rxcui { getset; }
        public string name { getset; }
        public string synonym { getset; }
    }
}





2 Replies

DR Deepak Ramakrishnan Syncfusion Team November 1, 2021 07:06 PM UTC

Hi Jim, 
 
Greetings from Syncfusion support. 
 
 
We are currently working on your requirement in our end. We will update the further details within two business days (03/11/2021). 
 
 
Thanks, 
Deepak R. 



DR Deepak Ramakrishnan Syncfusion Team November 11, 2021 04:35 PM UTC

Hi Jim, 
 
Thanks for your patience. 
 
We have validated the reported issue in our end , But unfortunately web api adapter is working in our end . We hae attached sample for your reference. 
Also we suspect that in the provided api link , mapped fields contains array of complex objects . So we request you provide the applicable fields and include all the fields in model value created at the client end  as like below code .



 
<SfAutoComplete TValue="string" TItem="OrderDetails" Placeholder="Select a name" Query="@Query"> 
    <SfDataManager Url="https://ej2services.syncfusion.com/production/web-services/api/Orders" Adaptor="Syncfusion.Blazor.Adaptors.WebApiAdaptor" CrossDomain=true></SfDataManager> 
    <AutoCompleteFieldSettings Value="CustomerID"></AutoCompleteFieldSettings> 
</SfAutoComplete> 
 
@code { 
    public Query Query = new Query().Select(new List<string> { "CustomerID" }).Take(6).RequiresCount(); 
    public class OrderDetails 
    { 
        public int? OrderID { get; set; } 
        public string CustomerID { get; set; } 
        public int? EmployeeID { get; set; } 
        public double? Freight { get; set; } 
        public string ShipCity { get; set; } 
        public bool Verified { get; set; } 
        public DateTime? OrderDate { get; set; } 
        public string ShipName { get; set; } 
        public string ShipCountry { get; set; } 
        public DateTime? ShippedDate { get; set; } 
        public string ShipAddress { get; set; } 
    } 
} 
 
 
 
Thanks, 
Deepak R. 
  


Loader.
Up arrow icon