$_SERVER variables in the data binding picker

Hello,

Can we get $_SERVER variables, like $_SERVER.REMOTE_ADDR in the data binding picker?

You already can.

When you set an input variable in SC you are not actually allowing the variable to be accesible to SC. You are just creating meta data for the UI to be able to pick it in other places(and optionally some SC data).

You could easily type it in the code view of the data picker and it would spit out the data in $_SERVER.REMOTE_ADDR

Just add it in your globals and it will be available across all SC flow in the data picker UI.

2 Likes

While you are both on this subject, do you know of any definitive list of $_SERVER variables for use inside NodeJS, so far my list is short
2022-02-10_23-27-18

It will depend on the server but here you have a few:

CONTENT_TYPE
HTTPS
PATH_INFO
QUERY_STRING
REMOTE_ADDR
REQUEST_PROTOCOL
REQUEST_METHOD
SERVER_NAME
BASE_URL
URL
HOSTNAME
HTTP_HOST
HTTP_PRAGMA
HTTP_ACCEPT_ENCODING
HTTP_COOKIE
HTTP_CONNECTION
HTTP_UPGRADE_INSECURE-REQUESTS
HTTP_ACCEPT
HTTP_USER_AGENT
HTTP_REFERER
HTTP_CACHE_CONTROL
HTTP_ACCEPT_LANGUAGE

3 Likes

Thank you, that will come in handy, I wish they had made them all the same as the PHP ones, would have made life a little simpler.

1 Like

Interesting. Wouldn’t it make more sense to make this meta data pre-populated though?

1 Like

I’ve thought about it, but I barely use a handful and some of them come from the request headers so they are set dynamically on runtime.

I just copy my globals from one project to another as I normally end up using the same.