Forum Discussion

Dicken's avatar
Dicken
Post Prodigy
1 month ago
Solved

Question mark as operator

Hi, can someone explain what ? does  in m code,  I know  ?? can coalesce a  null ot a vlalue  so ;  = List.Accumulate( {1..10}, {} , (s,c)=> s & { ( List.Last(s)?? 0 ) + c } ) but i'm not s...
  • ronrsnfld's avatar
    1 month ago

    It returns null instead of an error message when referencing a missing record field, list item, or column.

     

    Examine the code below and see how the results change from null to error if you remove the `?` from the relevant records:

    [Source=Table.FromColumns({{1,2,3}},type table[Column1=Int64.Type]),
        x=Source[Column2]?,
        y=Table.Column(Source,"Column1"){3}?]