Cannot use UserInfo fields for 'includes' in model condition

  • 2
  • Problem
  • Updated 3 years ago
  • Solved
Hello!

As the title states, I have a field that contains multiple strings that correspond to Salesforce UserNames. When trying to check if a UserName is contained in this field, I get the following error:


1. An error occurred while attempting to perform the following SOQL query: SELECT Comments__c,Level_1__c,Level_2__c,Level_3__c,Recommendation__c,TBA_Selection__c,TBA_Selection__r.Name,Tags__c,Value__c,Score_Type__c,Id FROM TBA_Score__c WHERE (Level_1__c = 'TLS')AND(Level_2__c = 'Vision: They dream big')AND(Level_3__c = 'Create a powerful vision')AND(Score_Type__c = 'Written Assessment')AND(TBA_Selection__c = 'a2A800000007tOeEAI')AND(Question__c = '1')AND(Tags__c = 'Written#, Q1#')AND(TBA_Selection__r.X2nd_Reviewer__c includes 'Eulogio Gallo') LIMIT 2 Error:expecting a left parentheses, found 'Eulogio Gallo'


It appears that Skuid isn't formatting the resulting SOQL query properly, forgetting the parentheses needed for the 'includes' keyword in the SOQL query. Not sure how to remedy this, but any advice would be appreciated.

Thanks!
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,874 Points 1k badge 2x thumb
  • unsure

Posted 3 years ago

  • 2
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Can you describe the way you've set up the condition?  Maybe post a screenshot of that last condition definition? 

You should be able to get this to work... 
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,874 Points 1k badge 2x thumb
Sure Rob, here it is:



Let me know if there's anything else I can do to help. Thanks!
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Ha.  We are actually making it impossible for you to use "includes" operators in that way.  This has been fixed in more recent packages available on Skuidify.com/skuidreleases..  

But I believe using a "contains" operator will work for you here. 
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,874 Points 1k badge 2x thumb
Normally I would use 'contains', but the option is not available to me. Only '=', '!=', 'includes', and 'excludes are available to me.

I've used workarounds to get this working, just wanted to know if this functionality was intended or not.

Thanks a lot for the feedback!
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
No worries.  Glad you got it working.  But I am bothered that you can not use "contains".   I don't believe that should be the case.  Maybe you can try to rebuild the condition from scratch...