Jump to content


Inserting variable value into Static Text


  • Please log in to reply
7 replies to this topic

#1 Guest_Matt01SS_*

Guest_Matt01SS_*
  • Guests

Posted 15 July 2009 - 09:39 PM

I was curious if there was a way to insert variable values into a static text parameter. In our program we submit a parameter which contains xml data representing data nodes for records. (Ex. <record><guid>ABCDEF</guid></record>) In this example, the program will know that it is record ABCDEF that is being updated. For my WAPT profile, the page along with the parameter gets submitted, however the "<guid>" value changes everytime a new record is created.

Basically, I need a way to do something like this: "<record><guid>$CurrentGUID</guid></record>". However, when I try something like that, the actual request keeps the variable name in there instead of switching it out for the variable's value.

Is there a better way to do this??

#2 Guest_angela_*

Guest_angela_*
  • Guests

Posted 17 July 2009 - 11:38 AM

QUOTE (Matt01SS @ Jul 16 2009, 04:39 AM) <{POST_SNAPBACK}>
I was curious if there was a way to insert variable values into a static text parameter. In our program we submit a parameter which contains xml data representing data nodes for records. (Ex. <record><guid>ABCDEF</guid></record>) In this example, the program will know that it is record ABCDEF that is being updated. For my WAPT profile, the page along with the parameter gets submitted, however the "<guid>" value changes everytime a new record is created.

Basically, I need a way to do something like this: "<record><guid>$CurrentGUID</guid></record>". However, when I try something like that, the actual request keeps the variable name in there instead of switching it out for the variable's value.

Is there a better way to do this??



It seems, no. A value is extracted by function $Search and saved into the variable, then the value placed into the right place by function $Var.

#3 Guest_Matt01SS_*

Guest_Matt01SS_*
  • Guests

Posted 17 July 2009 - 05:51 PM

QUOTE (angela @ Jul 17 2009, 07:38 AM) <{POST_SNAPBACK}>
It seems, no. A value is extracted by function $Search and saved into the variable, then the value placed into the right place by function $Var.


So theres no workaround for inserting variable data into the static text?

#4 Guest_angela_*

Guest_angela_*
  • Guests

Posted 20 July 2009 - 12:16 PM

QUOTE (Matt01SS @ Jul 18 2009, 12:51 AM) <{POST_SNAPBACK}>
So theres no workaround for inserting variable data into the static text?



It seems that you misunderstood my answer to your question. I meant that for inserting variable data into the static text you should use the functions $Search and $Var:

"A value is extracted by function $Search and saved into the variable, then the value placed into the right place by function $Var".

#5 Guest_Matt01SS_*

Guest_Matt01SS_*
  • Guests

Posted 20 July 2009 - 03:32 PM

QUOTE (angela @ Jul 20 2009, 08:16 AM) <{POST_SNAPBACK}>
It seems that you misunderstood my answer to your question. I meant that for inserting variable data into the static text you should use the functions $Search and $Var:

"A value is extracted by function $Search and saved into the variable, then the value placed into the right place by function $Var".


I'm sorry I still can't quite follow what you are saying. How am I supposed to use the $Search or $Var functions when I'm already using the Static Text function. I don't see how you use the $Var function within the Static Text function. When I tried doing, <guid>$Var</guid>, the request did not replace $Var with a value, it actually used $Var as text. (ie. the program submitted <guid>$Var</guid> instead of <guid>123</guid>)

#6 Guest_angela_*

Guest_angela_*
  • Guests

Posted 21 July 2009 - 11:35 AM

QUOTE (Matt01SS @ Jul 20 2009, 10:32 PM) <{POST_SNAPBACK}>
I'm sorry I still can't quite follow what you are saying. How am I supposed to use the $Search or $Var functions when I'm already using the Static Text function. I don't see how you use the $Var function within the Static Text function. When I tried doing, <guid>$Var</guid>, the request did not replace $Var with a value, it actually used $Var as text. (ie. the program submitted <guid>$Var</guid> instead of <guid>123</guid>)


Now we understand. You need to create a parameter using 3 functions: Static text, $Var and Static text (as it is shown on the picture below).


Attached File  parameter.PNG   17.29KB   84 downloads



#7 Guest_angela_*

Guest_angela_*
  • Guests

Posted 21 July 2009 - 12:07 PM

QUOTE (angela @ Jul 21 2009, 06:35 PM) <{POST_SNAPBACK}>
Now we understand. You need to create a parameter using 3 functions: Static text, $Var and Static text (as it is shown on the picture below).


Attached File  parameter.PNG   17.29KB   84 downloads


In other words, you need to combine several functions in one parameter. I.e. the parameter will be defined not by one function, but by 3 functions: the 1st part of the text in the 1st Static text function, then $Var function, and then the 2nd part of the text in the 2nd
Static text function.

#8 Guest_Matt01SS_*

Guest_Matt01SS_*
  • Guests

Posted 21 July 2009 - 03:25 PM

That worked beautifully! Thank you for the "work-around", I didn't know that adding multiple functions would concatenate together to make one value. Just what I was looking to do.

Thank You,
Matt




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users