Forum Discussion
null input parameters custom function
- Anonymous1 year ago
Hi Mic1979
could you please provide sample of your tables?
If you want to pass null to Input_Table_Column4, you should modify it with the optional keyword, such as (optional a)=>...
Also, Record.Field(_, Input_Table_Column4) should be replaced with Record.Field(_, Input_Table_Column4 ?? default_value_if_null).
- dufoq31 year agoCommunity Champion
Hi Mic1979, as ZhangKun mentioned: you should use optional keyword, but keep in mind that all optional parameter have to be at the end!. BTW. indstead of Record.Field(_, Input_Table_Column4 ?? default_value_if_null) you can use Record.FieldOrDefault(_, Input_Table_Column4, default_value_if_null)
- Mic19791 year agoPost Partisan
Hello dufoq3
Thanks, but why when I invoke the function in this way:
let
Source = MergeLP_3(Total_Sales_DOLLARS_TEST, PCBA_Type_List_Price_Adder, "Region", "Project_Step", "Fail_Safe_Description", null, null, null, "Region", "Project_Step", "Fail_Safe_Description", null, null, null, "Adder")
in
SourceI get this:
- dufoq31 year agoCommunity Champion
Because you haven't used optional keyword i.e.:
(tbl1 as table, tbl2 as table, optional col1 as text, optional col2 as text)=>And again:
- optional parameters have to be defined last.
- my recommendation: do not use custom functions. You do not need them in 99% of tasks.