Community Questions & Answers
Cloud Query Order Syntax
I want to query images in descending order (I want the newest first). What I have below is not working, they come back randomly every time. ~~~ Cloud.Photos.query({ order: "-created_at", limit: 3, skip: currentQueries*3 } ~~~ What should the...
ACS Object Querying Regex for array_tags
I'd like to query the first letters of the `array_tags` property. ~~~ Cloud.Objects.query({ classname: "ClassName", page: 1, per_page: resultNum, where: { tags_array: { '$regex':...
String matching in ACS
Hi Community, Is there a way of string pattern matching in ACS, e.g ~~~ SELECT * FROM suppliers WHERE supplier_name like '%bob%'; ~~~ In the example above , the query is looking for all suppliers whose name contains the characters 'bob'.
Query Posts in ACS using an array of User Ids
I am using ti.cloud 2.0.5 with SDK 2.0.2 GA on OSX Lion, developing for iOS. I can successfully query posts using a single user_id but I have been unable to pass an array. My overall goal here is to show all posts from my friends. I have successfully...
how to delete item from model anywhere of the app
Hi, I am learning alloy and I am liking it's model thing but I got stuck. somewhere in my code a user is able to kind of flag an item from the tableviewrow. This item's ID is then saved to memory using `Ti.App.Properties` to variable `flaggedId`. I...
What database to work with?
Hey there. Im building my first Titanium application for mobile. Its a very simple application where the idea more or less is to add the users information to a database and then return statistics based on all the user inputted data. Its only based on 3...
Android Database SELECT DISTINCT puts results in alphabetical order
I am calling a database file and pushing the results into a TableView. This is how I'm calling my code: ~~~ var db = Ti.Database.install('/categories.sqlite', 'list'); var rows1 = db.execute('SELECT DISTINCT cat FROM items'); while(rows1.isValidRow())...
How to query ACS selecting fields?
Right now an ACS query looks like a `select *`. There is a way to do a `select field1, field2` alike query so I can get only the fields I want at a give moment?
"in" condition with cloud where query
~~~ Cloud.Places.query({ page: 1, per_page: 20, where: { "custom_fields.subtype": { "$in": searchCrit } } } ~~~ searchCrit is an array of Strings of types of places. I structured the query so it would only return...
How to query the ACS logs
Is there an API to query the ACS logs? I'm adding additional logging on my side, but I need to investigate something that happened recently. There isn't a filter available in the cloud website to narrow down the records. Thanks, John
For loop e.REPLACETHIS.length
I have a for loop and I want to be able to change the return data by replacing the string between e. and .length. Anyone having an idea how I can do this? ~~~ for (var i = 0; i < e.REPLACETHIS.length; i++) { var return =...
Searchbar queries SQLite Database and brings up results in a new window
Hello all! I'm have a searchbar and a SQLite Database with a few columns, of which one of them is the "name" column. What I would like to do is to have the user type in a name in the searchbar to search the database for the row that matches what...
Delete SQL Query on Alloy Collections
Following [this example](https://github.com/appcelerator/alloy/blob/master/test/apps/models/sql_queries/controllers/main.js), I tried to implement my own "erase" method in a collection this way: ~~~ extendCollection : function(Collection)...
Parse.com Query Builder
Two questions, 1.) Is there any interest in a Parse.com query builder? Any feedback would be appreciated if you could give it a try: http://parse.whitneyland.com 2.) Would it be better to generate a full Titanium code method ready to drop in, or to...
Query files uploaded in the last 24 hours
Hi, How can I only query for files that were uploaded in the last 24 hours? I've tried for a while and just can't seem to get it. Any help would be very much appreciated. ~~~ Cloud.Files.query({ page: 1, per_page: 20, where: { ...
Can't connect to sqlite database in my Resources directory
Hi, in an Android project I must execute a SQL query using a database db.sqlite. The database is in the Resources directory (it is packaged with the app directly) and I use this code to query: ~~~ musicList.addEventListener("click",function(e){ ...
Querry a file with first_name not returning file from titanium cloud.
Hi am trying to query and get file on the basis of first_name but its returning an empty array of file, but when I go to cloud I saw there was a file corresponding to that first_name. I am using titanium sdk 2.1.3 GA and ti.cloud module 2.3.0 running app...
ACS Cloud Custom Objects - $or queries not returning any values
Hi, I have created a custom object on the ACS cloud and are querying it from a Titanium based iOS app. It works nicely as long as I only include a single set of criterias. I do however have a requirement to do 'or' selections. I haven't been able to find...
ACS - Query Users by user ids
Titanium SDK: 3.0.0 GA, **Cloud version: 2.3.0**, Mac OSX 10.8.2 I've been trying to query users by id, I've tried: ~~~ Cloud.Users.query({ page: 1, per_page: 1000, //id:{'$in': contactsArray.join()}, where: { user_ids: {'$in' :...
ACS Sort Order Not Working for Custom Object
I have created a custom object called Holes. When I query the object I want it to sort by "HoleNumber". I have tried ascending and descending but both return the same unsorted list. ~~~ { "meta": { "code": 200, ...
ACS Complex Where Clause on Custom Fields
All, I am just baffled by the syntax of the where clause used in ACS queries. If someone could kindly help me out, I'd appreciate it. I need to find records where custom_data.fieldX exists and custom_data.fieldX is false Many thanks in advance Bruce
ACS - Querying Events does not fetch Recurring
I've got several Events that are on the Cloud, many of them are recurring, some weekly, some daily. When I Query the Events: ~~~ ... Cloud.Events.query({ page: 1, per_page: 100, where: { start_time : { $gte :...
Use "order" in ACS Query.
Im trying to order ACS photos query but "order = created_at" doesnt seem to work. Tips anyone? Codesnippet: Cloud.Photos.query({ page: 1, per_page: 100, order = created_at, }, function (e) { for (var i = 0; i <...
Query ACS Places fields with LIKE operator and case insensitive
Is it possible to query places (insensitive) where: - name LIKE 'fred' - SQL would be something like: `SELECT * FROM Places WHERE name like '%fred%'` I.e. query would return (if existing): - Fred - Alfred - Winnefred If this isn't possible then I need...
passing string into sqlite select where in (xyz)
i need to pass a string eg '3,7,9' to another js where that then queries an sqlite database using the IN query - ive tried every combination of quotes, doublequotes, escaping etc and cant seem to work it out eg: ~~~ arraylines ='3,7,9'; if...
ACS: Query Places Based on Array of Place IDs
I am trying to query ACS Places based on an array of place IDs. My code looks like this: ~~~ Cloud.Places.query({ per_page: 30, where: { place_id: { '$in': ["506dc85a025afe7c2207100b","507f29659fdb0155d00003c9"] } } },...
ACS date type custom field query
Hello everyone, I'm developing a native iOS app which uses the ACS. I have a Place object with the following custom field: "startTime":"2012-10-13T13:49:47+0000" As you can see, I've configured the date string to be in a the...
Single row output in tableview??
Hi there. I was wondering, how do i only output 1 row in a table output? Im following the example of bountyhunter, but am making a resume for mobile. Im only checking it on IOS at the moment. Should i make a new SELECT query for the tableview? I should...
How to Add a Line Break to an SQLite Query
I have a lot of long queries in an app, and it would be really nice to be able to use line breaks in the query to make it more readable. I can do this in PHP, but every time I do it in Titanium I get a syntax error. Below is a simplified example. This...
Query using cURL in PHP
How to perform Query using cURL in PHP? I can run the actual cURL (similar to Example A below) via command line and it works fine. Now, I am aiming to write something similar to Example B below. Can anyone help with this? Thank you in...
Javascript Date and Time format for ACS
I am trying to Query Events by Date: ~~~ ... selectedDate = e.row.date; Ti.API.info(selectedDate); ~~~ Console Traces: `[INFO] 2012-09-30 03:15:57 +0000` ~~~ Cloud.Events.query({ page: 1, per_page: 10, where: { start_time:...
acs custom object field name
is there a way to get the field names stored in a class the following brings me the data from the class Cloud.Objects.query({ classname : 'classname', per_page : 100, where : { user : id } ......... ...... how can I display all fieldnames?
Query Photos uploaded only by friends
Hi. Wanted to know if there's a direct query whose response would be the array of photos uploaded by friends in ACS. Thanks in advance.
Getting empty resultset in database execute
in app.js ~~~ Titanium.Database.install('highScores.sqlite','highScoresDB'); ~~~ in scores.js ~~~ var db = Titanium.Database.open('highScoresDB'); var scores = db.execute('select * from scores'); Ti.API.info(scores.rowCount); ~~~ console prints 0! In...
ACS query questions
When I have a login on my app, should I be storing the user_id somewhere after successful login, either as a var within one of my modules, or as an app property? Which one is better and why? Right now, it seems I can query my custom objects without even...
ACS Query for Check-In's
Hello. I currently have a list where i query all the check-ins that the users make. However, the list won't query if a user decides NOT to add a picture to the check-in. Buttomline is: I am giving my users a opportunity to add a photo to their check-in....
Need help with access_token Facebook
ok so i have been at it now for some time and i still cant get it to work. have done a lot of googling as well as research here on the q&a but still cant find the answer so basically i want to pull the users name from facebook and show it in my...
Can't link FB username and picture to my profile in the app
hi so i have written this bit of code: //FB Ti.Facebook.appid = 'xxxxxxxxxxxxxx'; Ti.Facebook.permissions = ['publish_stream','read_stream']; Ti.Facebook.addEventListener('login', function(e) { if (e.success) { winInterface.open(); } ...
Query ACS Custom Objects - Group By?
Is there a "Group By" parameter for querying Custom Objects in ACS? If no, will it be available soon?
query users by location
hi, i would like to query my users based on their location. i have added "coordinates" property to my users. i know i can query custom objects based on location but can i also do that on users? just to make it clear, does the following code is...
how do i get IDs from ACS call
hi, i am working on a moblie app with ACS in titanium studio and i want to get id from a query. i want my code to perform something like this: ~~~ function getUserID(){ var id; Cloud.Users.query({ page: 1, per_page: 10, ...
Json Help
So, I'm developing an android app. I have a search, based on json. I'm getting an error when the answer to the search returns to my javascript. That error looks like the answer returns null, but the answer is written in my UI, so I have no idea what's the...
ACS - Query with selected values to limit results to.
I'm implementing an application with ACS as a main data base. __Application type : mobile, Android native application.__ __ACS with Android SDK__ I'd like to implement places search/query function with selected categories. Each place in ACS have...
ACS Query places added by user
I am trying to query a list of places which are added by the logged in user. How is this done? where: {"first_name": user.first_name} doesnt seem to work. Any ideas?
ACS - querying against tags for post gives no result
I have posts on ACS with tags. But I cannot get query result against tags for the posts. __Application type__ : Mobile(Android with Android SDK) __Device__ : Samsung Galaxy S __Test__ : Tested with CURL Belows are snapshot of my ACS DB. ~~~ 1....
ACS - Query in places : 'order=updated_at' doesn't work
I have a place DB in ACS that has about 2000 places. I've been trying to get sorted place list near a geo point. __The issue below is critical to our product.__ Belows are my query code written for Android with Android ACS SDK. ~~~ String where =...
Will SQLite Queries Always Happen in Order?
I'm trying to debug an issue in my iOS app, and I'm wondering if it's documented anywhere that queries will always occur in the order that you present them in your code. For example: ~~~ //Open DB var db =...
Problem with "left"
So, I have this code that creates dinamically row into a tableview. As you can see, I have a left:"30 px" defined so that the text wont be to close to the right border of the screen. The problem is that, when I get the result to my query for the...
ACS - Object Query returns 0 results.
I have a simple query that looks for an object (class: guest). If I query using user_id only i get results I expect. But if I query with two fields (user_id, event_id) i get no results, even though i can go to my dashboard and see those objects where...
access query string for custom url links
I read about using `Ti.App.getArguments()` but i am unable to figure out how to access it on osx. I have a link on a webpage like this `droplet://test?tester=rawr` and want to be able to read the query string. When I click on the link, my app opens, but...
Showing 1-50 of 71 1 2