g_scratchpad

SoniShaily
Tera Contributor

Hey everyone,
I’m trying to use a value from g_scratchpad in a catalog client script, but it keeps coming back as undefined. I’ve set the scratchpad value in a Catalog Server Script on the same item.
Am I missing something?

1 ACCEPTED SOLUTION

Rushi Savarkar
Mega Sage

Hello @SoniShaily 

Make sure your Catalog Client Script is running after the Catalog Server Script. g_scratchpad is only available on load.
Type = onLoad for the client script.

It won’t work in onChange or onSubmit unless you store the value in a variable.
Also, double-check that your server script is actually populating the value and that it's scoped to the right item or variable set.

Thank you!

View solution in original post

5 REPLIES 5

Rushi Savarkar
Mega Sage

Hello @SoniShaily 

Make sure your Catalog Client Script is running after the Catalog Server Script. g_scratchpad is only available on load.
Type = onLoad for the client script.

It won’t work in onChange or onSubmit unless you store the value in a variable.
Also, double-check that your server script is actually populating the value and that it's scoped to the right item or variable set.

Thank you!