Jump to content
WAPT Forum
Sign in to follow this  
Guest Matt01SS

Inserting variable value into Static Text

Recommended Posts

Guest Matt01SS

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??

Share this post


Link to post
Share on other sites
Guest angela
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.

Share this post


Link to post
Share on other sites
Guest Matt01SS
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?

Share this post


Link to post
Share on other sites
Guest angela
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".

Share this post


Link to post
Share on other sites
Guest Matt01SS
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>)

Share this post


Link to post
Share on other sites
Guest angela
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).

 

 

post-4-1248176037.png

 

 

Share this post


Link to post
Share on other sites
Guest angela
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).

 

 

post-4-1248176037.png

 

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.

Share this post


Link to post
Share on other sites
Guest Matt01SS

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...