model condition: rich text field != null not working

  • 2
  • Problem
  • Updated 4 months ago
  • Solved
The screenshot below shows a field editor with two fields: Id, and Notes__c. The condition on the model is Notes__c != null. Notes__c is a rich text field. Obviously, the model is pulling a bunch of rows with no value in Notes__c. Any idea what I'm doing wrong here?

Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Matt,

I just checked, and Rich Text fields apparently cannot be filtered via SOQL Queries, and hence you can't actually do any Conditions on them via Skuid. On our end, we should hide them from the list of fields to select for a Condition --- we'll add this to our issues list.

But on your end, you're left with 1 option: Create a custom checkbox field called "Has Notes", and use a Workflow Rule to update this field to be true / false whenever your Rich Text notes field is changed. I checked, and Workflow entry criteria CAN be based off of Rich Text fields. I wish you could use a Formula Field for this, but you can't.
(Edited)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Zach,

Thanks for the info.

I went with option #1 and changed the field type to Textarea. But I'm still getting the same result. The condition Notes__c != null doesn't appear to be filtering anything out, even when it's a textarea and not richtext. Any ideas?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
If I remember correctly - even TextArea (long text fields) cannot be filtered in SOQL.  Zach's answer will only work if you convert your field to a short text field (255 char).  This will probably not work for you.  So the reccomendation would be #2...
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
I updated my answer above to eliminate the idea about converting to a Long Text field --- Rob is right, this won't work either.
Hi there - is there any update on being available? I created a condition on a textarea field and had to do some digging matching to an existing salesforce report to realize it was not working properly. 
Photo of Zach McElrath

Zach McElrath, Employee

  • 48,984 Points 20k badge 2x thumb
Hi Lauren, you'll still need to go with the Workflow Rule approach, where you create a Boolean field to keep track of whether the Long / Rich Text Area field has a value, and then (a) setup a Workflow Rule that auto-populates this whenever the textarea field changes (b) Retroactively populate this field for existing records, if you are dealing with historical data.
Thank you - any chance a UI-only formula field would work? 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Unless something has changed with brooklyn, you can't build conditions on ui-only formula fields.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Nothing has changed.  You still can't build conditions on ui-only fields. 
It lets me build the condition..does it just not work?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Skuid, has this issue not been resolved?  As of 9.5.10 we can still build conditions on textarea fields.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Are you running into an issue here? This post is considered quite old by skuid standards.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
The issue is that I can build a condition on a textarea field and it doesn't do anything.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
I see. I'll ask around and see if anyone knows anything. Can you give any specifics about the condition? The more info the better.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I can build any condition I want on a textarea field, but it has no impact on the soql query that is performed. Note__c != null or Note__c contains "My Awesome Text" are two examples.

It just leaves a bad taste in the builder's mouth (not to mention confusion and frustration) to think they've successfully built a model that does what they want, only to find out that their conditions are irrelevant and they have to resort to workflow rules and sfdc boolean fields to get what they want.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Bump!

Just ran into this again... It's frustrating to build a perfect skuid model using conditions on textarea fields, only to remember later that textarea fields can't be used in conditions...