Filter DataSet

Filter the rows of a DataSet JSON file to include only rows with your desired properties.

Inputs

InputValue
dataSetUrlRequiredThe URL of the DataSet JSON file that you want to filter.
filterRequiredA filter expression, using C# DataView RowFilter syntax.

This allows you to filter DataSet rows based on column values. For example, Category='Prospect' AND Address LIKE 'San Francisco' AND AnnualRevenue>10000000 is a filter string that would output all rows where the Category column is "Prospect", the Address column contains "San Francisco", and the AnnualRevenue column is greater than 10 million.

Outputs

KeyValue
dataSetUrlThe URL of the filtered DataSet file.
storageFileNameThe name of the new filtered DataSet file.

Usage

Filtering a DataSet is a powerful action. There are many situations where you might have a large DataSet and you want to use only a subset of that DataSet that fits certain criteria. This is the action you want to use in such situations. You can use this to filter any DataSet; for instance:

  • A DataSet representing a form table (obtained via Get Form Table). Perhaps you want to grab all table rows that are above a certain cost because purchases above a certain amount require special approval.
  • A DataSet representing a Data Source (obtained via Get Data Source). Perhaps you want to generate a list of all contacts that you have for one specific customer.
  • A DataSet representing an external data source (obtained via one of a number of actions, e.g. Salesforce: Lookup).

Another common use case is when you want to extract individual column values from a particular row of your DataSet. In this situation, you can use Filter DataSet first to isolate the row you want, and then use Select DataSet Row with rowNum=1 to extract the column values.

In the example below, we show a use case where we want to find a single row in a GoFormz Data Source. Suppose you want to create a new work order form with some pre-filled data (e.g. customer information) whenever a new work order object is created in Salesforce — a <a href="https://support.goformz.com/customer/portal/articles/2921846-salesforce-integration", target="_blank">standard Salesforce workflow. But instead of getting the customer information (address, phone number, etc.) from the Salesforce object, you want to source it from a customer Data Source that you keep in GoFormz. The example below illustrates this scenario.

1028

In this example, before creating the form we convert the GoFormz customer Data Source to a DataSet file (Get Data Source), and then use the Filter DataSet action to filter that DataSet to contain only the row(s) that we want. The filter string here is Company=#{ForceLookup.[field_CompanyName]} AND Contact=#{ForceLookup.[field_AccountContact]}, which means that the resulting DataSet will consist of Data Source rows where the "Company" column matches the company name from Salesforce and the "Contact" column matches the account contact from Salesforce. Ideally you will want this to match only one row, but of course it depends on how your Data Source is structured. Then we extract the row values using Select DataSet Row and use those values in Create Form to fill form fields.