Select to view content in your preferred language

How to Create Inbox Query with DateTime Question?

503
4
01-17-2024 07:39 AM
Billy
by
Frequent Contributor

Hi, 

I'm using Survey123 Connect Version 3.19.104 and the survey is used in the mobile app only. 

I want to create an Inbox Query expression using a DateTime question. I tried different date-time formats in the SQL expression with no luck and I haven't found any documentation on how to this. I'm getting "Code 400 Cannot perform query.  Invalid query parameters."

What is the query syntax for this type of questions?

Regards. 

 

0 Kudos
4 Replies
YukoYokozawa
Frequent Contributor

My Inbox query expression is thie

CREATED_USER = ${username} AND LAST_EDITED_DATE > CURRENT_DATE - 180

The users can download only their data within 6 months

0 Kudos
Billy
by
Frequent Contributor

Hi YukoYokozawa,

Thanks for the reply. That works but what if I need something more specific like the example in the Survey123 documentation ( Prepare to edit existing survey data—ArcGIS Survey123 | Documentation)

I tried this syntax and got the 400 error. The second image shows the properties of the dateTime field and the syntax that I used. 

Billy_1-1705509044770.png

Billy_2-1705509391512.png

Billy_3-1705509540773.png

 

 

 

 

0 Kudos
YukoYokozawa
Frequent Contributor

Does your data show year-month-day? Check your data for the date, my data shows like this

YukoYokozawa_0-1705515654100.png

I would try 10/1/2023, if not work, then 10/1/2023 12:00 PM. So try different ways to express your date

 

0 Kudos
Billy
by
Frequent Contributor

Hi, 

I tried those but didn't work either. But search on the developer's documentation I found the syntax: Query (Feature Service)—ArcGIS REST APIs | ArcGIS Developers

Thanks for your answers. 

Billy_0-1705587164928.png

 

 

0 Kudos