The Problem
If you are opening a Zoho Creator Form from a third party, and it includes the query string as “?first-name=Rob”, there is no direct way to get the value of “first-name” into a field in your Form. It will not work because Deluge names can’t have “-” in them.
Question posted at : https://forums.zoho.com/topic/dealing-with-a-poorly-formatted-query-string
The Solution
There are only two places in Zoho Creator that can read URL parameters. 1. Form and 2. Pages. Both don’t accept “-” in parameter/field names. So, the optimal solution will be,
- Write a php file to convert “-” formatted query strings into “_” formatted query strings and open Zoho Creator Form with new query strings
- Host it on your server
- Link your hosted php file to your third party
The Php code
I have given the php code below. You can change the Location url to your Zoho Creator Form Url
$query_string = $_SERVER['QUERY_STRING'];
parse_str($query_string, $query_array);
foreach ($query_array as $key => $value) {
$newkey = str_replace("-", "_", $key);
$query_array[$newkey] = $value;
unset($query_array[$key]);
}
header("Location:https://app.zohocreator.com/aorborctechnologies/url-params/#Form:Contact?" . http_build_query($query_array) );
Demo
Click http://aorborc.com/samples/php/demo/param_fix.php?first-name=robert&last-name=m and you will be redirected to our Zoho Creator Form with the formatted query strings.