Answers Advanced - Module 5: Sorting

Hi there,

I am trying to wrap up my Module 5 Assessment for Answers Advanced and I can’t seem to pinpoint where I have gone wrong for the 2nd and 3rd verification.

From what I can tell everything is spelled correctly! Any help would be greatly appreciated!

Hi Eleanora,

I would try changing ’ “Sort Options,” ’ → ’ “Sort Options”, ’ with the comma on the outside. It could be something else, but that should hopefully get rid of the red underline squiggly.

Hi Eleanora,

Ivan is exactly right - thanks for contributing to the Community, Ivan! You’ll need to move the comma on line 17 out of the quotes so that it looks like:

"label": "Sort Options",

The reason for this is that the comma indicates the end of the object you’re notating. Since the comma is missing here, the code doesn’t recognize any code after that since it’s looking for a comma. In other words, the two rules failed because the search config doesn’t recognize defaultSortLabel or the sorting options. Once you move that comma, you should pass those rules!

Hi Ivan and Kristy,

Thanks for the help! I made that correction but now 2 errors have popped up on my module assessment so there must be something else at play.

Are there any screenshots I can provide that might help us troubleshoot this further?

Hi Eleanora,

You’ll also need to put a comma after the } on line 33 since SortOptions is just one object under componentSettings and the comma separates the components. You’ll notice there’s a red squiggly line under AppliedFilters, the next object you have under componentSettings. Let me know if that fixes it!

Another comma strikes again!! Thank you so much for your help!

Hey,

I’m getting the same errors on my report card as Eleanora:

image

Here is my events.json code:

{
  "verticalKey": "events", // The vertical key from your search configuration
  "pageTitle": "Event Search", // !!!REPLACE THIS VALUE!!! The contents of the title tag and meta open graph tag for title
  // "metaDescription": "", // The meta tag for open graph description
  // "canonicalUrl": "", // The link tag for canonical URL as well as the meta tag for open graph url
  // "keywords": "", // The meta tag for keywords
  "pageSettings": {
    /**
     "search": {
       "verticalKey": "events", // The vertical key from your search configuration
       "defaultInitialSearch": "" // Enter a default search term
     }
    **/
  },  
  "componentSettings": {
  "SortOptions" : {
    "container": ".sort-options-container",
    "defaultSortLabel": "Most Relevant",
  "options": [
    {
      "type": "FIELD",
      "field": "name",
      "direction": "ASC",
      "label": "Event Name"
    },
    {
      "type": "FIELD",
      "field": "time.start",
      "direction": "ASC",
      "label": "Event Date>"
    },
    "verticalKey": "events"
    "label": "Sort Options"
    }
  ]
},
    /**
    "QASubmission": {
      "entityId": "", // Set the ID of the entity to use for Q&A submissions, must be of entity type "Organization"
      "privacyPolicyUrl": "" // The fully qualified URL to the privacy policy
    },
    **/
    /**
    "Facets": {
      "title": "", // The title to display above the facets
      "expand": false, // Allow the user to expand and collapse the facets
      "showMore": false, // Display a link to see more facet options within a facet
      "searchOnChange": true // Will automatically run a search as facets are selected or unselected. Set to false to only trigger updates with an Apply button. 
      // Additional options are available in the documentation
    },
    **/
    /**
    "FilterLink": {
      "changeFiltersText": "sorts and filters", // Text that displays by default
      "resetFiltersText": "reset filters", // Text when filters are applied
      "clearSearchText": "clear search" // Text when there are no results, conducts an empty search
    },
    **/
    "AppliedFilters": {
      "removable": true
    },
    "VerticalResults": {
      "noResults": {
        "displayAllResults": true // Optional, whether to display all results in the vertical when no results are found.
      },
      "hideResultsHeader": true
    },
    "SearchBar": {
      "placeholderText": "Search", // The placeholder text in the answers search bar
      "allowEmptySearch": true // Allows users to submit an empty search in the searchbar
    },
    "Pagination": {
      "noResults": {
        "visible": true 
      }
    }
  },
  // Configuration used to define the look and feel of the vertical, both on this page and, by default,
  // on the universal page.
  "verticalsToConfig": {
    "events": { // The vertical key from your search configuration
      // "label": "", // The name of the vertical in the section header and the navigation bar
      // "verticalLimit": 15, // The result count limit for vertical search
      // "universalLimit": 5, // The result count limit for universal search
      "cardType": "eventoverride", // The name of the card to use - e.g. accordion, location, customcard 
      "icon": "calendar", // The icon to use on the card for this vertical
      "universalSectionTemplate": "standard"
    }
  }
}

I’m getting an add odd error here too:

image

Isn’t that standard?

Thank you,

Ashley