question

Amy M3 avatar image
0 Likes"
Amy M3 asked Amy M3 answered

table query return null

I have a table query and if it can't find a value, i get a null value and an exception error. How can i change this query to return a 0 if nothing is found?


double bpm=0;



Table result=Table.query("SELECT [Nominal] FROM Packing_BPM_Rates_Analog WHERE ([Material]=$1)", token.Material);

if (result.numRows>0)

return bpm=result[1][1];

return 0;

FlexSim 24.1.0
query
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·
Can you either post the exception message or the model please?
0 Likes 0 ·

1 Answer

Amy M3 avatar image
0 Likes"
Amy M3 answered

Yes, let me start a new post and i'll share model link.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.