web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Autocomplete on external API call

(0) ShareShare
ReportReport
Posted on by 410

Hi All,

Is there anyway autocomplete functionality can be implemented from an external API call in dynamic, Like when typing, a prediction of result from the  remote server showed drop down in dynamic and then the user can pick one ?. Someone with better knowledge showed please help.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    NODAL Profile Picture
    860 on at

    Hi Boss,

    What version you are on.

    If you're on version 9 you can try creating a custom control using PCF framwwork.

    Documentation: docs.microsoft.com/.../create-custom-controls-using-pcf

    Samples :https://pcf.gallery

    If you are not on latest version then try following sample.

    www.google.com/.../

    However with this approach you can fetch all data from external api using a custom action driven by a workflow.

    And then filter based on entered text.

    Regards,

    Ketan

  • Victor Onyebuchi Profile Picture
    410 on at

    @ketan I am using V9, the first link in your  reply is empty. With the gallery I think I should be able to use that. Where can I find the latest doc on pcf?

  • Suggested answer
    NODAL Profile Picture
    860 on at

    Hi Boss,

    You can find official documentation on below link.

    docs.microsoft.com/.../create-custom-controls-using-pcf

    Regards,

    Ketan

  • Victor Onyebuchi Profile Picture
    410 on at

    @ketan, i saw this in one of the countrols Gallery - "A control to select a value from a predefined list of values and automatically filters the values based on what the user types.". Does it mean that external calls using an API cant be made ? I am completely new to PCF, never written a code to develop PCF before.

  • Suggested answer
    NODAL Profile Picture
    860 on at

    Hi Boss,

    It is not the case, you can have dynamic values for your custom control.

    You can refer same pcf control from pcf galary and retrieve data dynamically instead of pre defined.

    Refer code :github.com/.../Autocomplete

    In that cods in file index.ts

    Replace following line.

     var optionsPropValue = context.parameters.options.raw;

    Here you can call your api and get data and set response Jason as optionsPropValue.

    And in menifest.xml you can comment out following line.

    <property name="options" display-name-key="optionsValue" description-key="List of options separated by comma" of-type-group="optiondatatypes" usage="input" required="true" />

    Regards,

    Ketan

    If this helps, please mark verified.

  • Victor Onyebuchi Profile Picture
    410 on at

    Ketan A quick question, how do i reference a field that i need to pass in the API inside the index typescript file ?. And the index file isnt in the AutocompleteControl solution file that willl be inported into dynamics, would a ny change in the index file affect the solution, since the index file is outside the solution.

  • Suggested answer
    NODAL Profile Picture
    860 on at

    Hi Boss,

    Whichever fields you want to refer for a control you can declare that in a Menifest.xml as bound parameter.

    You could declare unbound parameters as well like flags, api url etc as input parameter.

    Changes in index.ts won't affect packaged solution which is ready for import.

    Regards,

    Ketan

  • Victor Onyebuchi Profile Picture
    410 on at

    @ketan thanks for responding swiftly. since the index.ts is outside the solution file, it means any of my modifications wouldnt change anything in the solution right ?. sorry about all these questions, this is a diff level of coding for me. 

  • Suggested answer
    NODAL Profile Picture
    860 on at

    Hi Boss,

    Yes, to add new changes to solution you would need to build and package solution again.

    You can test your custom control before packing using following command.

    1) npm run build

    2) npm start

    Regards,

    Ketan

  • Victor Onyebuchi Profile Picture
    410 on at

    Thank @ketan. At this point, i will go with your second option - "However with this approach you can fetch all data from external api using a custom action driven by a workflow.", , as i have no exeperience in creating my own managed solution. Would be in my to-do list though, to create my own solution. I can fetch all the data from the external api and then save them in an entity, use OOB autocomplete to lookup the entity. Any example (link) of how/where this action is executed ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans