Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

dynamic url Parameters Help

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

dynamic url Parameters Help

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.

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

dynamic url Parameters Help

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...

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

dynamic url Parameters Help

Something like this:

Image

JavaScript for mapping:
Image

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

dynamic url Parameters Help

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 !

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

dynamic url Parameters Help

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 !

Return to “Issues”