PICKZEN
  • FAQ
  • Security in Pickzen
  • Builder
    • Builder Overview
    • Questions
      • Types and layouts
      • Display settings
      • Styling the text
      • Slide settings
      • Admin names
      • Slide help
      • Feedback slide
      • End slide
        • Number of outcomes
        • Forget results
        • Automatic redirect
        • Recommending content
      • Skip Logic
        • Branching controlled by slides
        • Branching controlled by tree
    • Products
      • Selecting products
      • Managing products
    • Linking
      • Linking choices to products
    • Install
      • Notification
      • Link
      • Button
      • Embedded
    • Lead Generation
      • Lead capture before recommendation
      • Receiving leads by e-mail
      • Sending e-mails to new leads
        • Adding customized data to e-mails
    • Advanced
      • Product attributes
      • Features table
        • Features from linking
        • Features from attributes
        • Smart texts
      • Insertable texts
        • User answers
        • Response based texts
      • Slots
  • Analytics
    • A/B Tests
      • Launching an A/B Test
      • Reviewing A/B test results
    • Insight panel
      • Overview
      • Responses
      • Leads
    • Parameters tracking
    • Sales tracking
  • Integrations
    • Your website
      • Pickzen Code
        • Installing the Pickzen Code in Shopify
        • Installing the Pickzen Code on any website
      • Add to cart
      • Add all to cart
    • MailChimp
    • Klaviyo
    • HubSpot
    • Zapier
    • Recharge
      • Recharge v1
      • Recharge v2
    • Product Feeds
    • Google Analytics
    • Facebook
  • Guides
    • Facebook/Instagram retargeting
    • HubSpot guide
    • MailChimp guide
    • Klaviyo guide
    • No-Code
      • Builder
        • Aliases
        • Tables
          • Executable tables
          • Data tables
          • Cell types
        • Settings
        • Simulation
      • Functions
        • ADDTO
        • CONCAT
        • EMPTY
        • EVALTABLE
        • EXTRACT
        • FIRST
        • FLAT
        • LOG
        • NTH
        • PERSONALITY
        • PRESCRIBE
        • PRESCRIBESLOTS
        • PROPERTY
        • RANK
        • RECIDS
        • RECGROUP
        • RECSKUS
        • REFINE
        • REMOVEFROM
        • SECOND
        • SLOTS
        • SPLIT
        • TABLEVALUE
        • TRUNC
      • Tutorials
        • Prescription Rules + Taglines
        • Calculator
  • Design System
    • Enabling the DS
    • The builder
      • Preview panel
      • Components panel
      • Properties panel
    • Properties
    • Variants
    • Properties values
      • Parametrization
      • References
      • Deferred actions
    • Components
      • [Base]
      • Button
      • Collapsable
      • Container
      • CoverSlide
      • Deck
      • Dropdown
      • EndFormSlide
      • EndSlide
      • FeedbackSlide
      • FormMapper
      • FormSlide
      • Grid
      • HTML
      • Icon
      • Image
      • InputDate
      • InputNumber
      • InputText
      • Label
      • Link
      • Product
      • ProgressBar
      • QuestionSlide
      • Repeater
      • Separator
      • SlideRenderer
      • Specs
      • TextArea
    • Views
    • Editor settings
    • Accesibility
    • Interceptors
    • HowTo
      • Show a variant programmatically
      • Use CSS in custom component
  • Administration
    • Managing accounts
      • Inviting collaborators
      • Requesting access
    • Copying pickzens between accounts
    • Replacing pickzens
    • Recovering versions
  • Developers
    • Developers panel
      • CSS customization
      • JavaScript customization
    • JavaScript API
      • Hooks
      • HOWTOs
        • How to add results
        • How to get the answers
        • How to decorate products
        • Escaping the iframe
    • REST API
      • API rate limit
      • Assistants resource
      • Responses resource
    • SDK
      • Documentation
        • Engine
        • Slide
        • CoverSlide
        • QuestionSlide
          • QuestionOption
        • FeedbackSlide
        • FormSlide
          • FormField
            • SelectorField
            • SelectorFieldOption
            • ImageField
        • EndSlide
          • Result
      • HOWTOs
        • Populate custom dropdown
Powered by GitBook
On this page
  • Syntax
  • Examples
  1. Guides
  2. No-Code
  3. Functions

PRESCRIBE

The PRESCRIBE function evaluates answer rules and returns items based on these rules.

PreviousPERSONALITYNextPRESCRIBESLOTS

Last updated 4 years ago

Syntax

PRESCRIBE(table, [rowsSelector, colsSelector, condition, out])

Argument name

Description

table

Required

Table to evaluate containing the prescription rules. See below.

rowsSelector

Optional

Selector of rows. All rows by default.

colsSelector

Optional

Selector of columns. All columns by default.

condition

Optional

matchall Only adds an item if it is contained in all matching rows.

matchany (default) Adds an item if it is contained at least in a matching row.

out Optional

Also includes the results in a list.

Table syntax:

Column name

Description

answer

Required, Multiple

Answer rules to evaluate.

mode

Optional

include (default) Includes the items (if not excluded).

exclude Excludes the items.

weight

Optional

Assigns points to items that will be used to order them.

rule

Optional

Selects items based on attribute rules.

<other columns>

Required

Any other column is treated as items holder.

Examples

Example 1

PRESCRIBE(mytable) If a1 is true, returns sku1 If a2 is true, returns sku2 and sku3 If a1 is true and a2 is true, returns sku1, sku2, sku3

Example 2

PRESCRIBE(mytable) If a1 is true and a2 is true, returns sku3, sku1, sku2. Note sku3 is returned in the first place because it has more weight as it appears in two matching rules.

Example 3

We can also use formulas that will be evaluated.

Example 4

We can use multiple answer columns. In this case, answer columns in each row have to be evaluated as true for the rule to be met.

PRESCRIBE(mytable) If a1 is true and a2 is true, returns sku2 If a1 is true and a3 is true, returns sku1

Example 5

PRESCRIBE(mytable) If health_bones is true and heath_sleep is true, returns sku2 and sku1. Note sku2 has more priority because of its assigned weight. If health_bones, heath_sleep, and allergy_fish are true, returns only sku2 because sku1 will be excluded according to rule 3.

Example 6

PRESCRIBE(mytable, ':', ':', 'matchall') If a1, a2, and a3 are true, it returns sku2 because it is the unique item that appears in all matching rules according to the matchall condition. If a1, and a4 are true, it returns nothing because there are no items that appear in all matching rules.

Example 7

PRESCRIBE(mytable, ':', ':', 'matchall') If a1 and a3 are true, it returns those products with tag cleanser that have size greater than 10. If a2 and a3 are true, it returns those products with tag serum or essential oil, that have size greater than 10.

mytable
mytable
mytable
mytable
mytable
mytable