Create a formula with Case statements for a field ...
# ask-stanley-ai
c
Create a formula with Case statements for a field where some specific text appears to return 1
c
AI generated answer (using internal Slack threads):
Based on the conversations, you can create a formula with Case statements for a field where some specific text appears to return 1 as follows:
Copy code
sql
CASE 
WHEN {FIELDID} IS NOT NULL THEN 1 
ELSE 0 
END
In this formula, replace
{FIELDID}
with the actual field ID you are checking. If the field is not null, the formula will return 1, otherwise, it will return 0. Here is another example where the formula checks if a custom item field equals 1 and returns a specific text, otherwise, it returns the value of the custom item field:
Copy code
sql
CASE 
WHEN ({custitemquantity_free_ship_customer} = '1') THEN 'ShipsFree' 
ELSE {custitemquantity_free_ship_customer} 
END
In this formula, replace
{custitemquantity_free_ship_customer}
with the actual field ID you are checking. If the field equals 1, the formula will return 'ShipsFree', otherwise, it will return the value of the field. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832166255
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829994619
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828706622
Please provide your feedback on this answer.