Get Value from field in service portal

IK Jeremy Ravel
Kilo Expert

Hello everyone,

In the service portal, I am trying to get the value of one field in my widget, to use this value for redirection

So I have tried in my controller $scope.page.g_form.getValue('u_otp'); , I have field name u_otp in my form but this doesn't seems to works

Does anyone has an idea, how could i do it ?

6 REPLIES 6

Right - that would be ideal. The value should be retrieved in the server script and then stored in the 'data' object. It could also be retrieved via REST from the Widget Client Script.



However, Jeremy specifically asked about a replacement for g_form.getValue() within the Form Widget, which doesn't exist outside of Service Catalog variables. The above example achieves what he asked for, which is getting the return value of a g_form.getValue() call to the Widget Client Script.



Thanks,


I am not sure to understand this correctly,


I don't think to work with two client script(onload/onchange) will be the clean ways to do it. How should I be able to get the data from the server script ? Sorry I am a beginner in angular, so I may miss so basic knowledge.



Just to explain a bit more,


What I am trying to do is to create a kind of duplicate function, to allows user to create similar record.


So I have my Request where user can attach task, so now, a user can create a first task, then click on a UI button, who will save the current record, and open a new record still link to the request. But I am not able to take the data from the first task to put it in the new form.


I hope this is clear, thanks for the help anyways