Custom SQL Functions return types mismatch column type | Community
Skip to main content
brianfmun
New Member
November 1, 2024
Solved

Custom SQL Functions return types mismatch column type

  • November 1, 2024
  • 1 reply
  • 849 views

Hi,
I've been trying to implement some custom SQL functions into the expression editor, but keep encountering one issue that interferes with a clean implementation. 
The function will return the correct value in the correct type, but the workflow table will choose the wrong type for the column, throwing this:

When I attempt to run a pretty simple function:

I've been able to work around this by wrapping the function a couple ways, for example:

But attempting to just call it as is (or pretty much any custom function), it will default the column to either an int or a string. 

Is this a known tricky thing to work around, or am I doing something wrong? DB is postgresql.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by brianfmun

Welp, I had tried adding a type and it was erroring out previously (and actually tried removing it because I looked at the ootb funclist.xml), but it's working today. Might have to chalk this up to the nightly restart "figuring it out".

1 reply

Amine_Abedour
Community Advisor
Community Advisor
November 4, 2024

Hello @brianfmun,

 

Have you tried to force the type of the returned value by adding a ''type'' attribute to the function node?

Exemples of OOB functions :

Br,

Amine ABEDOUR
brianfmun
brianfmunAuthorAccepted solution
New Member
November 4, 2024

Welp, I had tried adding a type and it was erroring out previously (and actually tried removing it because I looked at the ootb funclist.xml), but it's working today. Might have to chalk this up to the nightly restart "figuring it out".