Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/How can I filter for an enum payload field value in the frontend-config.js?Forum ↗

How can I filter for an enum payload field value in the frontend-config.js?

App Development3 posts238 views3 likesLast activity Oct 2021
GY
gyorgybalazsiOP
Oct 2021

This works, where the field value is simple text:

type: "contracts",
      filter: [
        {
            field: "argument.cmrId",
            value: "LP-HU000002"
          }
      ],

I have a status field on the contract, which is an enum:

data Status = DRAFT | ISSUED | CANCELLED | (...)  deriving( Eq, Show) 

I couldn’t find out how to specify the field value. This doesn’t seem to work:

type: "contracts",
      filter: [
        {
            field: "argument.status",
            value: "DRAFT"
          }
      ],
CO
cocreature
Oct 2021

You need to match on the constructor similarly to variants:

       {
            field: "argument.status.__constructor",
            value: "DRAFT"
        }
GY
gyorgybalazsi
Oct 2021

Awesome, thank you!

← Back to Discussions