Expand my Community achievements bar.

SOLVED

Custom SQL Functions return types mismatch column type

Avatar

Level 1

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:

brianfmun_0-1730504275953.png

When I attempt to run a pretty simple function:

brianfmun_1-1730504310694.png

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

brianfmun_2-1730504358603.pngbrianfmun_3-1730504412056.png

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 1

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

View solution in original post

2 Replies

Avatar

Community Advisor

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 :

Amine_Abedour_0-1730730903754.png

Br,

Avatar

Correct answer by
Level 1

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