kuklis / cma

2 stars 0 forks source link

vRA Custom Form Dropdowns with External Source | CMA #3

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

vRA Custom Form Dropdowns with External Source | CMA

Making dropdowns dynamic

https://kuklis.github.io/cma/post/custom-form-dropdown-external-source/

jlevak commented 1 year ago

Hello, thnx for this nice feature. It's working ok in my environment. But did you try the same thing to be populated from MS SQL DB? I wanted to add aprox 30 different services from DB and to use some other fields from the same query based on selected Property.

Bye, Jurica

kuklis commented 1 year ago

Hi Jurica, sure you can. Something like this should work:

var records = db.readCustomQuery("SELECT ApplicationName,ApplicationShort FROM Applications ORDER BY ApplicationName");

records.forEach(
  function (app) {
    apps.push(new Properties({label: app.getProperty("ApplicationName"), value: app.getProperty("ApplicationShort")}));
  }
);
return apps;