Jump to content
  • 0

Build a new column/field in a table with a formula. Is there a way to use an IF logic?


Maria

Question

Hello,

I am quite new to Caspio and  I am not sure if what I want to accomplish is possible.

I have a table in which I want to add a new field/column. That new column is going to combine/concatenate few of the other columns in the same table, but I need to use an if logic to complete what I want.
I did not see an IF option as a text formula. This is what I have written, but the formula is not correct:

image.png.66970471c3433284f95586a637977a43.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello @Maria,

Since SQL syntax is supported in the Formula field, please use the SQL CASE statement instead.

The syntax should be like:

CASE
WHEN Len([@field:Text]) < 2 THEN '0' + [@field:user_email]
WHEN Len([@field:Text]) > 2 THEN '1' + [@field:user_email]
ELSE [@field:user_email]
END

The ESLE part is optional.

The important note: each THEN/ELSE should return the value of the same data type.

You may refer to these articles:

https://howto.caspio.com/function-reference/

https://howto.caspio.com/tables-and-views/data-types/formula-fields/

Hope this helps.

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...