Kuroshi Posted November 30, 2019 Report Share Posted November 30, 2019 Hi, I created this formula: CASE WHEN [@authfield:field1] IS NULL THEN 0 ELSE [@authfield:field1] END When I verify it, it says valid. But when I preview it, it says Error in formula. Quote Link to comment Share on other sites More sharing options...
0 Barbie Posted November 30, 2019 Report Share Posted November 30, 2019 Hi Batchini, may you please try this Case when statement instead? CASE WHEN '[@authfield:BTN_User_Accounts_Permanent_Discount]'='' THEN '0' ELSE '[@authfield:BTN_User_Accounts_Permanent_Discount]' END I changed the IS NULL to ' ' hope it works on you. -Barbie Quote Link to comment Share on other sites More sharing options...
0 cheonsa Posted September 24, 2021 Report Share Posted September 24, 2021 For more reference, here's the link to the list of available formula: https://howto.caspio.com/function-reference/ Quote Link to comment Share on other sites More sharing options...
0 PotatoMato Posted January 15, 2022 Report Share Posted January 15, 2022 Hi, just to update this post. You may also check this how-to article regarding the causes of 'error in formula' message: https://howto.caspio.com/troubleshooting/errors-and-messages/ Quote Link to comment Share on other sites More sharing options...
0 Ulensr Posted January 20, 2022 Report Share Posted January 20, 2022 Hi you should also try to ensure that the type you are using in your calculation is consistent with what you wish to achieve. In Barbie's reply you end up with 0 as a string. If that is what you need fine, if not, you can use the Cast or Convert function as in LittleMsGinger's link You could try the followingCASEWHEN '[@authfield:BTN_User_Accounts_Permanent_Discount]'=''THEN Cast('0' AS int) ELSE Cast('[@authfield:BTN_User_Accounts_Permanent_Discount]' AS int) END Quote Link to comment Share on other sites More sharing options...
Question
Kuroshi
Hi, I created this formula:
CASE
WHEN [@authfield:field1] IS NULL
THEN 0
ELSE [@authfield:field1]
END
When I verify it, it says valid. But when I preview it, it says Error in formula.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.