1. Fields
  2. Select Resource Field

Fields

Select Resource Field

The Select Resource Field allows for selecting items from dynamic resources.

This can be used to select items from a dynamic resource such as states, contacts, or Google Sheets.

Basic usage

Adds a selectresource field to the fields of an action.
This will show all of the states defined in the flow in a select field.

loading...

Result

The field will be displayed as a select field as below:

The resultant data will be available in the stubpost.data as:

loading...

This can be substituted with eg. ~~stubpost.data.state_selector where required.

Parameters

See fields for common field parameters like validation and conditional rendering.

params.resource_name
required
string

The specific name of the resource you would like to load for selection.

One Of: states | contacts | google_sheets


params.dataresourceinterfaceuuid
optional

The UUID of the data resource interface that you would like to load for selection.

Google Sheets Interface Uuid: fb856d6a-8e69-4f52-a08a-0a01737196b1


params.details.orgcredentialuuid
optional

The UUID of the organization credential that you would like to use to access the resource.

See credentials for more information.


params.params
optional
object

Additional parameters specific to the resource in question. See examples below.


Examples

These are some more complex examples

Select value from a Google Sheet

This will allow selecting values from the specified Google Sheet.

loading...
Parameters (for google sheets example)
params.params.spreadsheet_id
required
string

The Google spreadsheetId.


params.params.sheet_title
required
string

The title of the sheet in the Google Spreadsheet.


params.params.filter_column
required
string

The column that will be used to filter the results and is used as the label in the select field.


params.params.additional_columns
optional
string/array

The additional columns that will be included in the result. This can either be an array of strings, or a comma separated string of column names.

If _all is used, all columns will be included.


params.params.cache_expire_seconds
optional
integer

Specifies the time, in seconds, to cache data from the sheet before it updates from the sheet.

This could speed up reads as it may not need to read the values from the Googlesheet each time this form is populated.


params.params.use_cache
optional
boolean

Specifies whether or not to use the cache when populating the select field values.


params.params.complex_query
optional
string

Allows you to perform more complex queries to filter out data not required in the select field values.

Uses mongodb like queries.

editor
        {
  "fieldtype": "selectresource",
  "params": {
    "dataresourceinterfaceuuid": "fb856d6a-8e69-4f52-a08a-0a01737196b1",
    "resource_name": "google_sheets",
    "details": {
      "orgcredentialuuid": "<credential-id from manage.stubber.com>"
    },
    "params": {
      "spreadsheet_id": "<id-of-your-google-sheet>",
      "sheet_title": "standard",
      "filter_column": "name",
      "additional_columns": "_all",
      "complex_query": "{ \"age\": {\"$lt\":\"30\"},  \"grouping3\": \"botswana\",  \"tags\": { \"$contains\": \"manager\" }}",
    }
  }
}

      

params.params.limit
optional
integer

Allows you to specify a limit to the number of items retrived to populate the field with.