Hi,
I have to Sort the data for six columns as below details
I can sorting column 1 , 2 and 5 but 3, 4, and 6 are not working from below function. I was updating context like {sortByColumn: 1, sortOrder: !sortOrder} so on....from Onselection of six different Sort icons for each column

Sort(
sharepointSitesCollection,
If(
sortByColumn = 1,
Text('Title (SiteTitle)'),
If(
sortByColumn = 2,
Created,
If(
sortByColumn = 3,
'PRIMARY_OWNER'.'DisplayName',
If(
sortByColumn = 4,
'SECONDARY_OWNER'.'DisplayName',
If(
sortByColumn = 5,
Text('Expiration Date'),
If(
sortByColumn = 6,
'External Access'
)
)
)
)
)
),
If(
sortOrder,
Ascending,
Descending
)
)
Thanks