In Server Connect you can define, use and re-use Session Variables. Once you define your session variables, they become available to choose in the dynamic data picker.
Defining a session variable is easy. In your server action, under Globals you will find $_Session:
Then add a name for this variable- this is your session variable name:
This can also be an existing session, created in some other script which you want to use in your server actions.
After you define it, the session becomes available in the dynamic data picker dialog, so you can use it wherever you need its value:
Can someone elucidate the other variables for someone like me who doesn’t come from a PHP background? A brief high-level explanation of how I might use each one would be very much appreciated. I ran a search for “Globals” in hopes of learning more about all of them and to avoid duplicating an existing topic. This Doc did a good job at helping me to better understand the $_SESSION variable although I would like to hear about an example scenario where it would come into use.
These are different things.
Sessions used in app connect are browser sessions.
The server sessions used in server connect are a totally different thing.
I have a form where I pass some user submitted data long with other parameters.
From what I gather reading the forum, it seems the way to do this is to create hidden fields and populate those with my data. However, this creates a potential security issue since Post data can be manipulated.
I’d like to pass user submitted form data along with other non-user submitted parameters to a Server Connect action.
I’m building a scheduling app. So there’s a user (with a backend profile stored in a user table) and a front desk person fills out the appointment and schedules it for day X at Y time. This information is submitted via a POST.
Then, I have user information (from the user table) such as copay (amount owed for each visit). So for the new scheduled event, I’d like to store the amount owed along with the event information submitted via the Post.
Correct. In some cases, I'd have to create 10+ hidden fields to pass the data. I am looking for a better way. Perhaps there is not better way, but I figured I'd ask.
That’s a good option. In the past few days, I’ve started to place all my processing logic into SC instead of App Connect. Starting out new (to dev), one of those things that may obvious to people with experience that you learn.
In the example I provided:
Front desk person fills out the appointment and schedules it for day X at Y time. This information is submitted via a POST.
Let’s say I need to add the service description to the appointment record which is stored in the Services table.
To do this serverside, I still need the initial ServiceID to do the lookup. Do you suggest passing this in via a hidden field?