Page 1 of 1

dynamic url Parameters Help

Posted: Fri Jul 27, 2012 3:57 pm
by Emmz

Hey Max !
Nice work on the Tiggzi Updates !

I'm hoping you can provide a simle example of how to use the Dynamic {} in the Parameters of a URL.
I have looked at The docs with limited help and other forum topics, but to no avail...
I'm loading JSON data from my server using REST Service.
The SQL Query part is what I need Dynamic. Not the URL itself.

Eg. URL http://www.myserver/test/mysql.php

REQUEST PARAMETERS
NAME VALUE
key test99
query SELECT * FROM app_reg WHERE 'Tech_ID' LIKE 'S123456'

I need the {S123456} of the query dynamic from text box on the page Named Tech.

Thanks.


dynamic url Parameters Help

Posted: Fri Jul 27, 2012 5:24 pm
by maxkatz

You need part of the request parameter value to be substituted?

Define 'query' as a regular request parameter and then in service mapping, run JavaScript and create the string (SELECT....) to be returned.


dynamic url Parameters Help

Posted: Fri Jul 27, 2012 9:17 pm
by Emmz

Thanks !
Can you show me the code for this please?
I tried this code in the ADD button under the Javascript header next to the query parameter..
var query = "SELECT * FROM app_reg WHERE 'Tech_ID' LIKE '" + Tiggr('Tech') + "'";

Sorry. Not much for JS experience. Thats why I'm using Tiggzi !

Thanks again...


dynamic url Parameters Help

Posted: Fri Jul 27, 2012 9:30 pm
by maxkatz

Something like this:

Image

JavaScript for mapping:
Image


dynamic url Parameters Help

Posted: Sat Jul 28, 2012 1:36 am
by Emmz

OH MAN !!! You are Awesome !!
This worked perfectly !
Thank you so much for help. You have obviously put some effort into this and
I'm great full.
Max.. Thanks again !


dynamic url Parameters Help

Posted: Mon Jul 30, 2012 9:41 pm
by Emmz

BTW... I see that the instructions on this are here..
http://help.gotiggr.com/getting-start...

I Said I looked for help but I guess I was wrong ! Sorry, and well done on the Doc.

That said. What about this scenario.
Updating database using multipal local storage variables.. ? eg.

INSERT INTO 'tech_activity' ('Tech ID', 'Date Time Posted', 'REF', 'Activity Type', 'Activity Info') VALUES ("value1","value2","value3","value4","value5")
When I can't map more than 1 item (values) to the query.
Any suggestions?
Thanks again for your help !


dynamic url Parameters Help

Posted: Fri Aug 03, 2012 1:16 am
by Emmz