Distinct value in column

With the below expression built by query builder

Fetch(of FSRoleMapping)(Nothing, Nothing, Nothing, Nothing, New ExpansionFieldOption(){addExpansionFieldOption("CreatedBy", New String(){"Id","Name"}), addExpansionFieldOption("UpdatedBy", New String(){"Id","Name"})})

The value returned includes duplicated values of the Name column. How can I change the expression to only return distinct value once.

Hi @QTH

Fetch(of FSRoleMapping)(Nothing, Nothing, Nothing, Nothing, New ExpansionFieldOption(){addExpansionFieldOption("CreatedBy", New String(){"Id","Name"}), addExpansionFieldOption("UpdatedBy", New String(){"Id","Name"})}).Distinct()

Hi @pravallikapaluri
I’m trying to use this in Apps builder not studio so your expression couldn’t work. Would you happen to know how my original expression can be amended to only return distinct values?

I got the error ‘Distinct’ is not a member of ‘ListSource(Of FSRoleMapping)’.

@QTH

Fetch(
  of FSRoleMapping
)(
  Nothing, 
  Nothing, 
  Nothing, 
  Nothing, 
  New ExpansionFieldOption() {
    addExpansionFieldOption("CreatedBy", New String[]{"Id", "Name"}),
    addExpansionFieldOption("UpdatedBy", New String[]{"Id", "Name"})
  }
)
.GroupBy(function(x) x.Name)
.Select(function(g) g.First())

Hope this will works for you

The following error surfaced:
Comma, ‘)’, or a valid expression continuation expected.
Identifier expected.
Comma, ‘)’, or a valid expression continuation expected.
Comma, ‘)’, or a valid expression continuation expected.
Identifier expected.
Comma, ‘)’, or a valid expression continuation expected.
Overload resolution failed because no accessible ‘New’ accepts this number of arguments.
Too many arguments to ‘Public Shared Overloads Function addExpansionFieldOption(fieldName As String,[selectedFields as String() = Nothing]) As ExpansionFieldOption’.
Overload resolution failed because no accessible ‘New’ accepts this number of arguments.
Too many arguments to ‘Public Shared Overloads Function addExpansionFieldOption(fieldName As String,[selectedFields as String() = Nothing]) As ExpansionFieldOption’.

Could you summarize the solution? My workplace device blocks external streaming sites like youtube and such.