Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

What does "ArrayElementCount" in JSON Threat Protection Policy means?

Not applicable

Can I use "ArrayElementCount" to determine how many employees are there in a department?

Here is my JSON:

{
  "dept": "Dev",
  "Employees": [{
    "empName": "Name1",
    "id": 123
  }, {
    "empName": "Name2",
    "id": 456
  }]
}

I want to basically limit the number of employees in a department to 1. Over here, we have 2 employees for the dept. Can i use JSON threat protection to implement this?

Solved Solved
1 7 772
1 ACCEPTED SOLUTION

Hi Mohit, thanks for the question .

When testing this myself, I see that it's not behaving as I would expect. In other words when I pass in an array that has a length greater than the limit specified in the policy, the policy does not trigger a fault.

I think this may be a bug in the implementation of the policy.

As a workaround, you could build a custom JS callout to check this. If you need help with that let me know, and I'll work up some code for you. or look here

View solution in original post

7 REPLIES 7