Home General Discussion

How to "Search by Critria" (API) using and extension field

Eric_EvansEric_Evans Member IT Monkey ✭

We can use the generic property "Display Name" in the "System.User.Projection" TypeProjection:


{
  "Id": "0e1313ab-dc5c-cf9d-d6b0-e2e9835a132a",
  "Criteria": {
    "Base": {
      "Expression": {
        "SimpleExpression": {
          "ValueExpressionLeft": {
            "GenericProperty": "DisplayName"
          },
          "Operator": "Equal",
          "ValueExpressionRight": {
            "Value": "John Doe"
          }
        }
      }
    }
  }
}

However, as soon as we try to use the extended property "Email" (Gathered from using the Cireson View Builder) it looks like it would be like this:




{
  "Id": "0e1313ab-dc5c-cf9d-d6b0-e2e9835a132a",
  "Criteria": {
    "Base": {
      "Expression": {
        "SimpleExpression": {
          "ValueExpressionLeft": {
            "GenericProperty": "$Context/Property[Type='CustomSIU_Users_Extensions!ClassExtension_83961915_686c_47a8_93ee_80842f829054']/EmailAddress$"
          },
          "Operator": "Equal",
          "ValueExpressionRight": {
            "Value": "John.Doe@email.com"
          }
        }
      }
    }
  }
}


Can you please explain to me what I am doing wrong, and what the best way to do this would be?

Answers

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭

    @Eric_Evans - You're using "GenericProperty". You might try "Property". You might also try using the guid of the class rather than the full SCSM path. Something like this:

    {
      "Id": "0e1313ab-dc5c-cf9d-d6b0-e2e9835a132a",
      "Criteria": {
        "Base": {
          "Expression": {
            "SimpleExpression": {
              "ValueExpressionLeft": {
                "Property": "$Context/Property[Type='eca3c52a-f273-5cdc-f165-3eb95a2b26cf']/EmailAddress$"
              },
              "Operator": "Equal",
              "ValueExpressionRight": {
                "Value": "John.Doe@email.com"
              }
            }
          }
        }
      }
    }
    


Sign In or Register to comment.