Get selling plan group data

In workflows that require selling plan group data, you can use the Get selling plan group data action to retrieve order information from your store.

Configuration

Fields

The Get selling plan group data action contains the following fields, which are used to build the query:

Fields used in the Get data actions.
FieldDescription
Sort data byRequired. The parameters by which the data returned by the search query is sorted.
Maximum number of resultsRequired. The maximum amount of results that can be returned by the search query that you select. You can return up to 100 at a time.
QueryRequired. Choose from common queries or select Advanced to create your own.

Query String

This is an example query for getting selling plan groups that were updated in the last day:

name='Subscribe & Save'

The category variable is a filter available on the Selling plan group query and can be used to select specific categories of selling plan groups.

When querying data, it's helpful to know:

  • List of available selling plan group filters
  • Query field names for all queries can be found in the developer docs for the QueryRoot object.
  • Query field values are not always documented. In some cases, the values can be found by looking at the API docs. Alternatively, you can often find the field values in the URLs in the Admin when you filter. For example, to find some Order query values, filter the Orders page in the Admin, and then check the URL.
  • You can run or test a query in your shop by using the Shopify GraphiQL app.
  • Be mindful of what happens if your query fails. Often the API will return all results (instead of none).

Returned data

All Get data actions return a list of anywhere from 0 and 100 resources. Depending your use case, you might want to use this data in various ways:

  • If you need to handle each list item individually, such as to add a tag for each, then you can use the For each action.
  • If you need to aggregate data, such as count how many results were returned, then you can use the Count or Sum actions.
  • If you need output the list, such as send an email with all the items, then you can use returned data directly in susbsequent actions.

To access the returned data in steps that follow this action, use the variable named Get selling plan group data, which is a list of selling plan groups. You can use this variable in both conditions and actions. For example, you can send the list of selling plan groups in a Send internal email action like this:

{% for getSellingPlanGroupData_item in getSellingPlanGroupData %}
  {{getSellingPlanGroupData_item.name}}
{% endfor %}

Example

For example, a workflow is scheduled to run every Sunday at 9:00 am. The Get selling plan group data action is used to collect data for selling plan groups created in the last week. If the products associated with the selling plan groups are your best sellers, then the position of the selling plan group can increase.

API Reference

Ready to start selling with Shopify?Try it free