Search Components

Search Components are Compounds that can be used to filter collections of data on supported field types. When compounds are used as a search component, the compound will render above the field it’s on and a Search button will be visible. When the search button is selected the XML generated from the fields in the compound will be passed to the field the search component is on where it will be used to filter the data.

The XML generated from the fields in the compound will be included in the payload to the fields target within the <SearchParameters> element.

If you’re not familiar with Compounds or want to create your own, refer to the Adding Compound Field Definitions to your Functionality article for more information.

Below is a list of fields that support search components:

  • ChildList
  • Report
  • Card
  • Chart

DateRange

This is a generic compound included in Server Owner that is intended to be used as a search component where the data needs to be filtered by a start and end date.

The payload to the fields target will include the following XML:

<SearchParameters>
    <DateRange>
        2023-01-10 09:15:23 - 2023-01-22 10:00:00
        <Start>2023-01-10 09:15:23</Start>
        <End>2023-01-22 10:00:00</End>
    <DateRange>
</SearchParameters>

If you’re using TSQL as your target, here is an example of how to extract the start/end dates into variables from the AdditionalInput parameter:

--Parse @AdditionalInput and assign values to parameters...
DECLARE @XML AS XML = @AdditionalInput;
DECLARE @StartDate AS DATETIME = @XML.value('/ID[1]/DateRange[1]/Start[1]', 'DateTime');
DECLARE @EndDate AS DATETIME = @XML.value('/ID[1]/DateRange[1]/End[1]', 'DateTime');
			
--Select statement that uses @StartDate and @EndDate to filter results...

GenericSearch

This is a generic compound included in Server Owner that is intended to be used as a search component where the data needs to be filtered by a string value.

The payload to the fields target will include the following XML:

<SearchParameters>
    <GenericSearch>
        YourGenericSearchTerm
    <GenericSearch>
</SearchParameters>

If you’re using TSQL as your target, here is an example of how to extract the generic search value into a variable from the AdditionalInput parameter:

--Parse @AdditionalInput and assign values to parameter...
DECLARE @XML AS XML = @AdditionalInput;
DECLARE @SearchValue AS VARCHAR(300)= @XML.value('/ID[1]/GenericSearch[1]', 'VARCHAR(300)');
			
--Select statement that uses @SearchValue to filter results...
Updated on April 22, 2024

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment