Skip to main content

Hi there, I'm new to SKUID and am trying to create a Ui-only formula field on a contact page layout that returns 'Yes' or 'No' for someone based on the segmentation row that they fall into.

Below is the formula, which appears to work in Salesforce but not in Skuid. The field type is Formula, and return type is Text. The formula returns nothing in the page view.

Any thoughts are helpful!

IF( 
OR(ISPICKVAL(ANI_Segmentation_Row__c , 'CMNSS1'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'CMNSS2'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'CMNSS4'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'CMNSS5'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'CMSS1'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'CMSS3'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'K12NCM1'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'K12NCM2'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'OK12W1'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'OK12W2'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'OK12W3'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'PNSL1'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'PNSL2'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'PNSL3'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'SLFS1'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'SLFS2'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'SSANR1'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'SSNCM1'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'SSNCM2'), 
ISPICKVAL(ANI_Segmentation_Row__c, 'SSNCM3')), 

'Yes','No')

Hi Melody!


I’m pretty sure it isn’t your formula, especially if it works in salesforce. Just a couple questions first to try and trouble shoot,  do you query the model your ‘ANI_Segmentation_Row__c’ field is in on page load or at least before you try to view the yes/no field? And is that field selected in the model’s fields?


As it is a Ui-only formula field, if you don’t query the model before it doesn’t have any data to load and if the field isn’t selected in the model as well it won’t be able to load in the formula either.


If yes to both of those, is the ‘ANI_Segmentation_Row__c’ a picklist field or a text field? ISPICKVAL() is a function for picklist fields only. If it’s a text field you can just do it with CASE() or an IF() statement I think.


Let me know how you go!


Hi Melody,


First of all, welcome to Skuid!


Not all of the formulas available in Salesforce Formulas are available in Skuid — ISPICKVAL() is one of them. As Emma said, there’s a cleaner approach using CASE():


CASE(

{{ANI_Segmentation_Row__c}},

‘CMNSS1’,‘Yes’,

‘CMNSS2’, ‘Yes’,

‘CMNSS4’, ‘Yes’,

‘CMNSS5’, ‘Yes’,

‘CMSS1’, ‘Yes’,

‘CMSS3’, ‘Yes’,

‘K12NCM1’, ‘Yes’,

‘K12NCM2’, ‘Yes’,

‘OK12W1’, ‘Yes’,

‘OK12W2’, ‘Yes’,

‘OK12W3’, ‘Yes’,

‘PNSL1’, ‘Yes’,

‘PNSL2’, ‘Yes’,

‘PNSL3’, ‘Yes’,

‘SLFS1’, ‘Yes’,

‘SLFS2’, ‘Yes’,

‘SSANR1’, ‘Yes’,

‘SSNCM1’, ‘Yes’,

‘SSNCM2’, ‘Yes’,

‘SSNCM3’, ‘Yes’,

‘No’

)


Here, {{ANI_Segmentation_Row__c}} is pulling in the value of the {{ANI_Segmentation_Row__c}} from the Contact record, and then all of the subsequent lines are saying "If ANI_Segmentation_Row__c is this, then return “Yes”, with the final “No” being the default that is returned if none of the cases are met.




Hi Zach! Thanks for this solution. I’m circling back to this now - I’ve used the above case formula, but the page layout still always returns the default value (“No”, in this case).


Reply