PortalX Star QL Choice and DateTime - How to Check Time Sensitive Dates and Expiry on Application Offers


Article Description/Introduction

This article is to show you how to use Star QL Choice in Portal X when you need to check an application or process step against a time-sensitive expiration. This article applies to PortalX for Cloud where the DateTime function was introduced to refer to "now" or "this instant" where as on PortalX on-prem the Date function was used. This article will show you how to build the Star QL Choice query using "Simple Mode" and then changing the code generated in "Advanced Mode" so that an application passes the choice step properly. In this example we will create a Star QL Choice that checks if an application is "Within Offer Period"

Instructions

  1. For an application to be "Within Offer Period" the following conditions have to be met:
              - the field "OfferSentDate" has to be before DateTime (now)
              - the field "Offer Expiry Date" has to be after DateTime (now)
  2.  DateTime is a function that returns the current date and time when Star QL choice checks an application. If "now" or "this instant" the current date and time is 10:05 AM on Monday, November 4th, 2024 then DateTime will return the value 2024-11-04 10:05:00 AM 
  3. We will assume that the application was sent an offer on November 1st, 2024 at 11:00 AM so the value in the field "OfferSentDate" = 2024-11-01 11:00:00 AM
  4. We will assume that the application expires on November 10th, 2024 at 9:00 AM so the in the field "Offer Expiry Date" = 2024-11-10 09:00:00 AM
  5. Log into PortalX and navigate to the process graph where you will be checking an application and "Add Choice"
  6. Select "Star QL Choice"
  7.  Select the Star QL Choice that was inserted into the process graph and inspect the Settings
  8.  Choose the name of your StarQL Choice, eg. "Within Offer Period"
  9.  Begin building your query in Simple mode, select a starting table for the query, Select what you would like the query to show (eg. EntryApplicationID) and finally choose how to filter the result.
    Note: Here we will use Simple mode to filter the query using DateTime

    In this example "OfferSentDate" has to be before DateTime (now) 

  10.  Once these two filters have been entered your settings will look like this:
  11. Finally, click the "Advanced" tab on the top right of the settings window and you will see the Star QL query that is built based on your choices.

    Please notice that DateTime has been entered with "Quotation Marks"
  12.   

What's Next?

We are ready to complete the query. All you have to do is remove the quotation marks around DateTime and then save your query. Below is what the final correct query should look like: