Name of the session variable with the field value

How to get the session variable with the field value?
I use a field on my form and want to save not ID but value.
the name of the session value I used for that field is mycomm.
so I supposed to use $_GET[“mycomm”] to get the value, right?

$_Get is an array that holds parameters that are passed in the url. If you have set a global variable and selected method ‘get’ then this parameter is send as part of the url but is stored as a global variable. So you can access it as [your var] (regular global var).
I highly recommend not using this technique, but use session globals. Using get and post has security implications.

Hi.
So how I can get the value of the field instead of ID
Lookup method
“select ID,comment from p_comment”
Data type: text autocomplete
I want to save comment not ID.
and one more question.
WHat if there is no record. How to save new comment?

Well you have the key do you need to request the data manually. Afaik that’s the only way.

The ID should be available in the onAfterInsert event