query string date format

  • 1
  • Question
  • Updated 9 months ago
  • Answered
I am try to pass the date in a page include but must not have the date 01/01/1900 in the correct format.

Help?
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb

Posted 9 months ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
If you want a condition on a date field in the include page to pick up the parameter value, you will have to pass it in the following format   1900-01-01T05:00:00.000Z .   If you pass in a date field value in your query string - I suspect it will work correctly - but you have to remember that the Page Include component does not have context - so you have to use global model merge syntax. 

If you truly want the text "01/01/1900" to be passed in your query string - you will have to URL encode the values using the URL Encoding merge syntax (look for global functions here: https://docs.skuid.com/latest/en/skuid/merge-syntax/global-merge-variables.html

Or... what are you trying to do? 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Bill.  I would simplify the include page.   

Make a page that correctly gets the date condition right and then look at the generated SOQL in the developer console to see what value is actually getting passed to the query.  Then match that value in the Page Include URL parameter field. 

Simplify the include page down so that the only condition in play is the one from the URL parameter.    I think your condition logic is suspect. 

Good luck. 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Unfortunately I expected this would be more of a science than an art. What is the answer?
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Bill,

Try YYYY-MM-DD as the format.  Here is an example query string:

&duedate=2018-02-02

Thanks,

Bill
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Tried it and it does not work
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Bill,

I may have misled you.  When I posted the query string, I included the ampersand (&).  You don't need to add this when you include the parameter in the 'Query String' field of the page include component.

The Query String should 'just' be:  duedate=2018-02-02

If that does not work, please post the XML from your model.

Also, are you trying to show records from a particular timeframe?  Salesforce provides an easy way to filter records by date using defined intervals like:  TODAY, TOMORROW, THIS_WEEK. 

You can enter a query string like this:  duedate=TODAY

To show records with a due date of today's date.  This kind of condition will always work whenever run.

Thanks,

Bill