Home > Forum > General > Populating Dropdown List from REST

Populating Dropdown List from REST
0

Hi there
has anyone an example on how to populate dropdown lists from REST data sources ?
I got the working requests in POstman, but I cannot get them to work at all in webcon.
and its kinda hard to debug since error messages or logs are seemingly not available...

thanks for your help in advance.

MVP

Hi Denckert,

there's not any difference in populating a drop down via a REST data source or any other.

Once the REST data source is defined you are good to go. This is explained here:
https://community.webcon.com/posts/post/rest-data-sources/173/27

Regarding logs, where does it fail?
Does the test of the data source definition work in the Designer?
Otherwise you could check the following:
Enable diagnostic tracing from the avatar icon, load the Form, save the session and open the link with an admin user.
If you can use it in a path transition action you can take a look at the history, switch to admin mode an click on the action. You may be able to get additional information there. If you are using a rest action the whole request with body, headers and response will be logged. :)

Best regards,
Daniel

In reply to: Martin Meze (Freelancer)

Hi there! Is the REST publicly available and can share details about it? It would be much quicker to help on a real case.

maybe I am missing something, but to me , WEBCON throws an error message right when I edit the get requests in the datasource.
the complete get request works flawlessly in POSTMAN, yet it cannot be ported to webcon without fail

the api is from MS Business central
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/endpoints-apis-for-dynamics

I tried both oauth2.0 and anonymous connections and the error is the same, see pic / screenshot

MVP
In reply to: Denckert, Lutz

maybe I am missing something, but to me , WEBCON throws an error message right when I edit the get requests in the datasource.
the complete get request works flawlessly in POSTMAN, yet it cannot be ported to webcon without fail

the api is from MS Business central
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/endpoints-apis-for-dynamics

I tried both oauth2.0 and anonymous connections and the error is the same, see pic / screenshot

From the print screen it looks like you're getting an HTML response with the login form and not json as Webcon expects. Are you using the same account when making the call from Postman and Webcon?

Also, in the scope URL you have a dot before the word "default". Is this correct?

MVP

Hi,

it's may be to late for this question but it may help others.

I've come around to test and write a post about "debugging" such situations. My example uses also Business Central with a picker field.. But I am using a user with a web service access key is used. I know it's deprecated, but this post isn't focused on setting up OAuth.
It also doesn't work with WEBCONAPPS.

https://daniels-notes.de/posts/2022/debug-web-service-datasource

Best regards,
Daniel

MVP
In reply to: Dominik Wördehoff

Hi Peter,
you mentioned the "pickerFilter" in REST Datasources. How can I use this to filter data?
E.g. in Data table with Rest Datasource I can't find a possibility to set a value for it.
thanks for your help in advance.

Hi Dominik,

the picker filter (1) in the expression editor will help you in the context of a popup search/autocomplete field.

In case of a data table you could probably access the (2) "All form fields". This will retrieve the value of the field for the current instance.

I actually noted this option only a few month ago and I don't know since when it is available. :)

Best regards,
Daniel

Privacy overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.


To see a full list of the cookies we use and learn more about their purposes, visit our Privacy Policy.