Filter-NRIC processor

To filter Singapore’s NRIC format, one can make use of the filter processor.

Use a JavaScript Filter and enter this format/^S[0-9]{7}[A-Z]{1}$/g.test(NRIC) where NRIC is the fieldname to test.

New format of NRIC uses the character “T” to start and can be detected using /^T[0-9]{7}[A-Z]{1}$/g.test(NRIC).

Steps taken:

  1. Create a composite datasource (+.ds). Drag and drop the tabular datasource (Data.ds) as the beginning of the flow.
  2. Add a “Filter” element following the tabular datasource. In Filter #1, add the following column:Name=NRIC, Type=String, When=JavaScript, Condition=/^S[0-9]{7}[A-Z]{1}$/g.test(NRIC)
  3. In Filter #2, add the following column:Name=NRIC, Type=String, When=JavaScript, Condition=/^T[0-9]{7}[A-Z]{1}$/g.test(NRIC)

Upon rendering, only strings that meet the NRIC format condition will display.

To download the necessary files for this recipe, refer to the attached ZIP package.
Filter-NRIC.zip