Hello Guys,
New powerapps user here, I Would like to get help on how can I insert sorting codes on my current formula on my Gallery view.
If(
varDatacount < VarDelegationLimit,
Filter(
Filter(
'Luzon NAFS Dacion',
STATUS.Value = ComboBox1.Selected.Value || ComboBox1.Selected.Value = Blank()),
FilterByNameDacion.Text in Title || FilterByNameDacion.Text in STATUS.Value || FilterByNameDacion.Text in 'ACCOUNT NAME'),
Filter(
'Luzon NAFS Dacion',
STATUS.Value = ComboBox1.Selected.Value || ComboBox1.Selected.Value = Blank())
)
Hoping for your kind assistance.
Thank you and Stay Safe!
If you set up two dates with the start and end of the current month, you can query between them - First of month is
Date(
Year(Now()),
Month(Now()),
)
Last day of month (a bit trickier)
If(
Month(Now()) = 12,
Date(
Year(Now() + 1),
1,
1
) -1,
Date(
Year(Now()),
Month(Now() + 1),
1
) - 1
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
oh no, How can I make it delegable? Thank you
Hi @nmlsanmiguel ,
Note this is not Delegable
Month(YourDateField) = Month(Now()) && Year(YourDateField) = Year(Now())
This code works for me! Thank you.
Would also like to know if how can I filter dates automatically for the current month? Thank you.
There is no Sort criteria in that code and I do not see any error lines - have you typed the full code in ?
Hi Sir, I am Still getting an error upon doing,
Hi @nmlsanmiguel ,
I am not sure what you mean - you just need to replace YourSortField with your field name (and also the direction)
Hi Sir, appreciate the help, but when I am trying the IF code you have shared, I can't find the Sort Field which was a Date column. Thank you.
Hi @nmlsanmiguel ,
The problem you have here is that while you have that in filter in the statement, the query is not Delegable, so you might as well do this
With(
{
wData:
Filter(
'Luzon NAFS Dacion',
STATUS.Value = ComboBox1.Selected.Value ||
ComboBox1.Selected.Value = Blank()
)
},
Sort(
Filter(
wData,
FilterByNameDacion.Text in Title ||
FilterByNameDacion.Text in STATUS.Value ||
FilterByNameDacion.Text in 'ACCOUNT NAME'
),
YourSortField,
YourSortDirection
)
)
You can try this as well
If(
varDatacount < VarDelegationLimit,
Sort(
Filter(
'Luzon NAFS Dacion'
STATUS.Value = ComboBox1.Selected.Value ||
ComboBox1.Selected.Value = Blank()
),
YourSortField,
YourSortDirection
),
Sort(
Filter(
'Luzon NAFS Dacion'
(
STATUS.Value = ComboBox1.Selected.Value ||
ComboBox1.Selected.Value = Blank()
) &&
(
FilterByNameDacion.Text in Title ||
FilterByNameDacion.Text in STATUS.Value ||
FilterByNameDacion.Text in 'ACCOUNT NAME'
)
),
YourSortField,
YourSortDirection
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
146,596
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional