AnsweredAssumed Answered

How to determine the environment and pass to a plugin

Question asked by mrab on Apr 7, 2017
Latest reply on Apr 26, 2017 by mrab

I have a form in Service Catalog that accesses an external database using a plugin and I need to pass the environment (test, QA, production) to the database query.  I can determine the environment by using a ReportQuery to get the Service Catalog server name, but I am having trouble getting that derived value passed to the plugin.


What I have tried: 

I use a java script function that 1) parses the server name from the ReportQuery to get the environment and 2) sets a text field in the form to that environment.  I call that function in the onLoad attribute of the form.  I can see the value in the text field when the form gets loaded, but the environment getting passed into the plugin is not that value.  The value that gets passed is 'TEST', which is the default value on the text field.


How can I get the derived environment value to pass to the plugin?


Here are the two pertinent form components:
 Text field       

  • id:   server_env  
  • name:  server_env  
  • value:  TEST


  • id:  sel_aix  
  • Report/Plug-in Id:   QueryDatabasePlugin
  • Report/Plug-in Variables: $({'serverEnv':ca_fdGetTextFieldValue(ca_fd.formId, 'server_env')})