Hi,
I'm using a search bar in my Powerapp form, but it is showing some error in the function
SUPD is my sharepoint list name
Employee Name is the my Tittle coloumn
When the user searches the employee name ,i want the data to be filtered only by showing the names
Could anyone helped me to fix this
Solved! Go to Solution.
Switch(vartabselected,
1,
SortByColumns(
Filter(SUPD,
StartsWith('Employee Name',TextInput1.Text)
),
"Title",
Descending
)
,
2,
SortByColumns(
Filter(SUPD,
StartsWith('Employee Name',TextInput1.Text),
'Access Details '.Value = "Display"
),
"Title",
Descending
)
,
3,
SortByColumns(
Filter(SUPD,
StartsWith('Employee Name',TextInput1.Text),
'Ticket Status '.Value="Created"
),
"Title",
Descending
)
,
4,
SortByColumns(
Filter(SUPD,
StartsWith('Employee Name',TextInput1.Text),
(
'Approval Status - Reporting Manager '.Value ="Rejected"
||
'Approval Status - SPoC'.Value="Rejected"
||
'Approval Status - SME '.Value="Rejected"
||
'Approval Status - HoD'.Value="Rejected"
)
),
"Title",
Descending
)
)
Hopefully the above explains a bit - you can't have two separate statements inside - how will the program know what to include - imagine trying to type two different statements in Excel without anything to join/combine them, it's the same here, we have to define some way they interact
In this case for each of the switch statements, we have a filter that includes the searchbox and the condition that applies to that selected tab for the filter
If you have any questions about the code please feel free to ask!
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
You are missing the column to sort by
SortByColumns(Filter(SUPD, StartsWith('Employee Name', TextInput1.Text) ), "created", Descending)
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Hi,
Thanks for your response
I'm, passing two function in my item property , But it is showing some error
Could u please help me to fix it
Can you paste the code please, I'm not going to try re-typing that.
You can't use two functions in your items, you need to simplify it into a single item - For each item of vartabselected, we would have the startswith from the first line - if you paste your code here I can help clean it up
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Hi thanks for the repsonse
I've shared the code with you please look into it
SortByColumns(Filter(SUPD,StartsWith('Employee Name',TextInput1.Text)),"Title",Descending)
Switch(vartabselected,1,SUPD,2,Filter(SUPD,'Access Details '.Value = "Display"),3,Filter(SUPD,'Ticket Status '.Value="Created"),4,Filter(SUPD,Or('Approval Status - Reporting Manager '.Value ="Rejected",'Approval Status - SPoC'.Value="Rejected",'Approval Status - SME '.Value="Rejected",'Approval Status - HoD'.Value="Rejected")))
Switch(vartabselected,
1,
SortByColumns(
Filter(SUPD,
StartsWith('Employee Name',TextInput1.Text)
),
"Title",
Descending
)
,
2,
SortByColumns(
Filter(SUPD,
StartsWith('Employee Name',TextInput1.Text),
'Access Details '.Value = "Display"
),
"Title",
Descending
)
,
3,
SortByColumns(
Filter(SUPD,
StartsWith('Employee Name',TextInput1.Text),
'Ticket Status '.Value="Created"
),
"Title",
Descending
)
,
4,
SortByColumns(
Filter(SUPD,
StartsWith('Employee Name',TextInput1.Text),
(
'Approval Status - Reporting Manager '.Value ="Rejected"
||
'Approval Status - SPoC'.Value="Rejected"
||
'Approval Status - SME '.Value="Rejected"
||
'Approval Status - HoD'.Value="Rejected"
)
),
"Title",
Descending
)
)
Hopefully the above explains a bit - you can't have two separate statements inside - how will the program know what to include - imagine trying to type two different statements in Excel without anything to join/combine them, it's the same here, we have to define some way they interact
In this case for each of the switch statements, we have a filter that includes the searchbox and the condition that applies to that selected tab for the filter
If you have any questions about the code please feel free to ask!
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Hi, Thanks for your insightful advice ,its worked perfectly fine
I wonder why we shouldn't pass the code at the beginning as for all rather than passing the sort by columns function on each tab property.
I had issues with the variable approach to Sorting in the past so it's a habit now to include the whole sort/filter/condition inside each switch - not sure if that's been fixed but "once burned, twice shy" as they say
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
User | Count |
---|---|
125 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
215 | |
180 | |
139 | |
97 | |
83 |