setNumber

142 views
Skip to first unread message

nano...@gmail.com

unread,
Jan 13, 2015, 11:00:47 AM1/13/15
to suppor...@runmyprocess.com
I need help. I want to set a textbox with in my interface with a result of a process

<@script env="javascript">
function sumar_Valores(a,b) {
var c = new Number(a) + new Number(b);
return c;
}

var r = sumar_Valores(a,b);
print(r);
setVariable("sum",r);
</@script>

this is the function. Just put the result in the text box but with this output variable

Takafumi Hoshino

unread,
Jan 13, 2015, 4:42:23 PM1/13/15
to suppor...@runmyprocess.com
Hi,

Do you want to set textbox widget with process variable?
or, do you want to do calculation in process side? (the example script you gave us look like this)

Assuming first one is correct, there are number of ways to do this.

Each widget has variable and id.
For example if your text widget was labeled "first name", then likely the default value and id will be,

variable
first_name

and
id
id_first_name

Then, if there was the same variable name in process, it will be automatically read into the webform as it opens.

So, 1 idea is to use same variable name between process and widget.

Another one would be, if you write below syntax in Javascirpt widget, it will pre-populate the script with corresponding variable value.

var name = "[[first_name]]";
// double-quotes needed because it is a string value

This case, above script will be written in web interface, JS widget.
The "first_name" is process variable.

Then, if you needed to calculate something and set the number.

You need to know the widget id in web interface.
After the calculation is done, do,

id_widget.setNumber("number_as_string");

Best regards,

Taka



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://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/0c3688cb-435c-4ba9-afba-b447ffa87a11%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.



--
---------------------------------------------------
Taka Hoshino
Fujitsu RunMyProcess
Google Account: thos...@runmyprocess.com
<Sent from Gmail web client>

Hernan Alberto Del Campo Cabezas

unread,
Jan 19, 2015, 9:48:15 AM1/19/15
to suppor...@runmyprocess.com
ok, but, how can i use an output variable of a process and use it in the API listener and set a textbox with the variable value? (it is a number)

You received this message because you are subscribed to a topic in the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/Ov-BhAqiNXE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supportforum...@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
Reply all
Reply to author
Forward
0 new messages