Jump to content
  • 0

Formula to combine fields to work even there is an empty field


alexmshcare

Question

I need to combine the content of 4 fields in one field in the table. The data type is number.

When one of the fields is empty, the formula does not work.

Can someone help me, please?

CONVERT(VARCHAR(10),[@field:AssignedAgentPrimary_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned1_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned2_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned3_STID],101)

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello Alex.

Using "ISNULL" -> https://howto.caspio.com/function-reference/#:~:text=IsNull(value%2C replace_value) will work for your case as it will check if the value is null and return an empty string instead of null(which will cause the formula not to work as "null" is not a string)

For your case, you can also use CAST to convert the number, like this:
 

ISNULL(CAST([@field:AssignedAgentPrimary_STID]  AS VARCHAR), '') + ',' +
ISNULL(CAST([@field:AddtlAgentAssigned1_STID] AS VARCHAR), '') + ',' +
ISNULL(CAST([@field:AddtlAgentAssigned2_STID]  AS VARCHAR), '') + ',' +
ISNULL(CAST([@field:AddtlAgentAssigned3_STID] AS VARCHAR), '')

 

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...