Elaborate dinamically the value choosen from a list in the web interface

377 views
Skip to first unread message

Luigi

unread,
May 3, 2017, 7:19:31 AM5/3/17
to Fujitsu RunMyProcess Developer Community
Hello,
I have a list widget in a Web Interface for info got from a web service.

The list contains several codes where the first 2 characters identify a type.
For examples: 018901, 078922, 038855,ecc... (type is 01, 07 , 03...)

I would like to get the value choosen in the list by the user (value variable), extract the type and then DINAMICALLY show in the same web interface the corresponding meaning of the type got from a custom list (es. "01 update budget", "03 increase budget", "07 move budget"...).

Is it possible ?
Can you show some example ?

Thank you !

Ghanshyam Mule

unread,
May 3, 2017, 8:10:00 AM5/3/17
to suppor...@runmyprocess.com, Luigi Cichella
Hi Luigi,

Yes.This is possible.

For this,i have taken two custom list.
In the first custom list, i have set value to custom list as suggested by you.(For ex.Label-01, Value-"01 update budget")
Second list is variable based list.(You can take other widget also).

You can use below code snippet:-

var selected_value=id_list.getSelectedValue("list"); //To get value with respect to type code selected 

var vb_list= new Array();     //defined an array
var a1 = new RMP_List();   //defined a list

vb_list.push({"label":selected_value,"value":selected_value});    //By using list pushing selected value to array

a1.fromArray(vb_list);     //pushing value from arry to list

RMPApplication.setList("list_value",a1);    //Set value to variable based list.list_value is a list variable for second custom list

id_dynamic_list.reset();    // reset value of variable list.(In case if you want to select multiple values from custom list)

Please confirm that this will satisfies your requirement. 

If you have other queries please feel free to contact us.

Regards,
Ghanshyam mule
Fujitsu RunMyprocess Support


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/95d46b22-5049-4e07-964c-d1eacf84d78e%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

Luigi

unread,
May 3, 2017, 11:51:47 AM5/3/17
to Fujitsu RunMyProcess Developer Community, ciche...@fatergroup.com
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
Hi Ghanshyam,
could you, please, clarify further ?

As I understand you put the selected values in another new list with just a value and a label while I would like to put the code selected and the code description into 2 separate variable in the web interface.

That is, I have:
- a custom list : code_translation
- a widget list : id_codes_available
- a calculated text widget: id_code_selected
- a calculated text widget: id_code_description
(result looking into code_translation for "${id_code_selected[0..1]}"

So, I suppose the javascript should be put in both the calculated fields...

Thank you,
Luigi





Ghanshyam Mule

unread,
May 4, 2017, 6:50:52 AM5/4/17
to suppor...@runmyprocess.com, Luigi Cichella
Hi Luigi,

You can follow below specified steps:-

1.By using getSelectedValue() function you can retrieve value of selected item from custom List.
   
      Ex.var selected_value=var selected_value=id_codes_available.getSelectedValue("codes_available");   //code_available is value variable of list widget 

2. Similarly, to retrieve label value you need to use function getSelectedLabel()   
  
      Ex. var selected_label= id_codes_available.getSelectedLabel("label_codes_available");      //label_codes_available is label variable of list

3.Using RMPApplication.set() function set value to Text-field.
   
      RMPApplication.set("code_selected",selected_value);
      RMPApplication.set("code_description",selected_label);
 
If you have other queries please feel free to contact us. 

Regards,
Ghanshyam Mule
Fujitsu RunMyProcess Support




To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Gunjan Rajgure

unread,
May 5, 2017, 11:35:12 PM5/5/17
to suppor...@runmyprocess.com, Luigi Cichella
Hi Luigi,

Could you please confirm that issue has been clarified?

For any other query, please don't hesitate to contact with us.

Thanks & Regards
Gunjan Rajgure
Fujitsu - RunMyProcess Support

Luigi

unread,
May 8, 2017, 6:27:00 AM5/8/17
to Fujitsu RunMyProcess Developer Community, ciche...@fatergroup.com
Hi Ghanshyam,
I first used the test console on the WI to verify the result of the formula:
id_codes_available.getSelectedValue()
and it works, showing the value selected.

Then:
I created a Text widget to show the result (identifier: id_request_id)

I created a JS widget in the WI, containing
var selected_value=id_codes_available.getSelectedValue();
RMPApplication.set(id_request_id,selected_value);

Now, running the WI and selecting a value, the text widget does not show any result.
I verified and "selected_value" contains surely the right value but the text widget "id_request_id" is not set.

what am I doing wrong ?

Thank you.












Dipen Raval

unread,
May 8, 2017, 9:31:33 AM5/8/17
to suppor...@runmyprocess.com, ciche...@fatergroup.com
Hi Luigi,

I have checked the code which you have provided,
you have passed identifier of the text widget in below line.

RMPApplication.set(id_request_id,selected_value);

Instead of using the identifier, can you please check by using variable name of the  text widget.

Ex : RMPApplication.set("variable_name_of_text_widget ",selected_value);

Hope this helps you.Do let us know if you have any further query.

Thanks & regards,
Dipen Raval
Fujitsu - RunMyProcess Support

To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

ciche...@fatergroup.com

unread,
May 8, 2017, 10:07:27 AM5/8/17
to Fujitsu RunMyProcess Developer Community, ciche...@fatergroup.com
Hi Dipen,
yes, putting the "variable_name_of_text_widget" it works but only if I copy the the javascript in the JS console e run it
I would like to have a WI variable/widget to be dinamically set when I select a value in the list.
Is it possible ?

Thank you!



Gunjan Rajgure

unread,
May 8, 2017, 11:36:39 AM5/8/17
to suppor...@runmyprocess.com, Luigi Cichella
Hi Luigi,

You can Show selected Value/Label from your list widget to text widget. Just need create a JS widget in the WI, containing,

  var selected_value = id_codes_available.getSelectedValue(); // To get selected value from List
  RMPApplication.set("show_value",selected_value); // Set the selected value into the text widget which has value variable as show_value.

Like this, you can also get the Label of List. And show it on another text widget eg. show_label. 

  var selected_label = id_codes_available.getSelectedLabel();  // To get selected Label from List.
  RMPApplication.set("show_label",selected_label); // Set the selected Label into the another text widget.

And make your JS widget as Listen to Variables. Use value variable of list widget as Listen to Variables in property of JS file.

Note : show_value is the value variable of text widget where you are going to show selected value and show_label is the value variable of text widget where you are going to show Label

Hope this will help you. Still if you are facing any issue, please feel free to contact with us.

Thanks & Regards
Gunjan Rajgure
Fujitsu - RunMyProcess Support


To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

ciche...@fatergroup.com

unread,
May 9, 2017, 5:47:38 AM5/9/17
to Fujitsu RunMyProcess Developer Community, ciche...@fatergroup.com
On Monday, May 8, 2017 at 3:31:33 PM UTC+2, draval wrote:
Hello,
problem solved using the variable name of the text widget and correcting the "Listen to variables" of JS widget.

Than you!

Luigi

unread,
May 9, 2017, 5:49:12 AM5/9/17
to Fujitsu RunMyProcess Developer Community, ciche...@fatergroup.com
Hello Gunjan,
correcting the "Listen to variables" of JS widget, it works.

Thank you !
Reply all
Reply to author
Forward
0 new messages