Condition.name return null for Skuid Page Viewer

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
I have the below script to deactivate the conditions,
var params = arguments[0],
$ = skuid.$; var ContactSearchModel = skuid.model.getModel('ContactSearch'); $.each(ContactSearchModel.conditions, function(i, condition) { console.log(condition.name); // only deactivate conditions created by table searchbox if (condition.name.indexOf('searchbox') > -1) { ContactSearchModel.deactivateCondition(condition); } } );

I have two users;
1. User A: admin user
2. User B: Skuid Page Viewer

This works fine for user A while the user B is the one who only get this issue.
console.log(condition.name); prints null for user B,

Why is this happening? What am I missing here?
Photo of Hasantha Liyanage

Hasantha Liyanage

  • 1,446 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Hasantha Liyanage

Hasantha Liyanage

  • 1,446 Points 1k badge 2x thumb
Hi Folks! I found the issue here, silly mistake. I haven't given the required permission to the field used in the condition , so which caused the null return. Thought this will be useful to someone else someday and posted as the answer.
Cheers!
(Edited)
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Hey Hasantha, Like your perseverance.  Skuid on!