Hi @ShadowTech
I'm glad that my previous answer was useful. Let's now clarify a few points.
1. For the new button:
The logic depends a lot on your column data type or format. Try displaying the date in a label first to identify what kind of date you are extracting from SharePoint.
Sometimes you need to transform the date before making any comparisons. For example, if you have a date stored in a text field, you can use DateValue to convert a string to a date. In my example, Created is a date column, and the formula below is working just fine:
currentFilter = "New",
Filter(
Filter(
'Employee Training',
Created >= DateAdd(
Today(),
-1,
TimeUnit.Months
) || Title = "TrulinX Training"
),
Category = currentCategory
),
2. The "Not Started" Button:
The code you have for the "Not Started" button is incorrect. In my last response, I made a small change by using a different operator (<>) to filter all names different from the current user's name.
Again, I cannot give you the exact formula because I don't know the properties of your people column. A good approach could be displaying the value in a label to figure out the property name where the full name is stored. Additionally, keep in mind that the full name in SharePoint might not be the same as in Dataverse.
I just changed the formula of the filter to show you how you should apply the filter if your column has for example a property called DisplayName, in this case my table column name is User, its an object an im using the DisplayName property:
currentFilter = "NotViewed",
Filter(
Filter(
'Employee Training',
User().FullName <> User.DisplayName
),
Category = currentCategory
),
3.The Search Button:
That's correct. In my previous response, I used the modern controls, which is why I referenced TextInput1_1.Value. However, if you are using the older controls, your formula should look something like the sample below.
Additionally, your formula depends on the outcome you want to achieve. In my previous example, we used the StartsWith function, which checks just the start of your string. If you want to check the input value within the entire text, you should use the Search function instead. The Search function allows you to search for the keyword in any place across several columns simultaneously. The formula should look something like this:
currentFilter = "Search",
Filter(
Search(
'Employee Training',
TextInput1_1.Text,
Title,
course_description
),
Category = currentCategory
),
4. Categories:
Pretty much the same. I'm just giving you an example based on the information you provided; it may or may not work depending on your exact requirements. If you have 13 categories, my previous answer might be cumbersome. So, instead of using that complex Switch function, let's try something different.
If you have a table, array, or collection with your categories, and your categories have an ID or index, you can take a different approach.
I started by creating my entire categories table:
ClearCollect(
Categories,
Table(
{Index: 1, Category: "Category1"},
{Index: 2, Category: "Category2"},
{Index: 3, Category: "Category3"},
{Index: 4, Category: "Category4"},
{Index: 5, Category: "Category5"},
{Index: 6, Category: "Category6"},
{Index: 7, Category: "Category7"},
{Index: 8, Category: "Category8"},
{Index: 9, Category: "Category9"},
{Index: 10, Category: "Category10"},
{Index: 11, Category: "Category11"},
{Index: 12, Category: "Category12"},
{Index: 13, Category: "Category13"}
)
);
Set(currentCategoryIndex, 1);
Set(currentCategory, LookUp(Categories, Index = currentCategoryIndex).Category)
In this case i have created a table of categories and each category has an index that will help to navigate with the arrow buttons
this is the code for the right button:
Set(currentCategoryIndex, If(currentCategoryIndex < CountRows(Categories), currentCategoryIndex + 1, 1));
Set(currentCategory, LookUp(Categories, Index = currentCategoryIndex).Category)
and this one is for the left button:
Set(currentCategoryIndex, If(currentCategoryIndex > 1, currentCategoryIndex - 1, CountRows(Categories)));
Set(currentCategory, LookUp(Categories, Index = currentCategoryIndex).Category)
This aproach is much better because you can add infinite categories without changing the arrows code.
And finally this is my on start code so you can understand how im builing everything to be as similar as your case as possible, maybe it will help you to understand the logic of the filter:
ClearCollect(
'Employee Training',
Table(
{
Created: Date(2024, 06, 15),
Title: "Course 1",
course_description: "Introduction to Power Apps and its basic functionalities.",
Used: false,
User: {
UserEmail: "usuario_pwp@hiberusspo365demo.onmicrosoft.com",
DisplayName: "PWP Prototype"
},
Category: "Category 1"
},
{
Created: Date(2024, 05, 20),
Title: "Course 2",
course_description: "Advanced SharePoint integration techniques.",
Used: true,
User: {
UserEmail: "usuario_generico1@ejemplo.com",
DisplayName: "Generic User 1"
},
Category: "Category 2"
},
{
Created: Date(2024, 04, 10),
Title: "Course 3",
course_description: "Building custom connectors in Power Apps.",
Used: false,
User: {
UserEmail: "usuario_generico2@ejemplo.com",
DisplayName: "Generic User 2"
},
Category: "Category 3"
},
{
Created: Date(2024, 03, 25),
Title: "Course 4",
course_description: "Understanding Power Automate workflows.",
Used: true,
User: {
UserEmail: "usuario_generico3@ejemplo.com",
DisplayName: "Generic User 3"
},
Category: "Category 4"
},
{
Created: Date(2024, 05, 15),
Title: "Course 5",
course_description: "Creating responsive designs in Power Apps.",
Used: false,
User: {
UserEmail: "usuario_generico4@ejemplo.com",
DisplayName: "Generic User 4"
},
Category: "Category 5"
},
{
Created: Date(2024, 02, 20),
Title: "Course 6",
course_description: "Using Dataverse for data management.",
Used: true,
User: {
UserEmail: "usuario_generico5@ejemplo.com",
DisplayName: "Generic User 5"
},
Category: "Category 6"
},
{
Created: Date(2024, 07, 10),
Title: "Course 7",
course_description: "Securing your Power Apps environment.",
Used: false,
User: {
UserEmail: "usuario_generico6@ejemplo.com",
DisplayName: "Generic User 6"
},
Category: "Category 7"
},
{
Created: Date(2024, 08, 05),
Title: "Course 8",
course_description: "Best practices for Power BI integration.",
Used: true,
User: {
UserEmail: "usuario_generico7@ejemplo.com",
DisplayName: "Generic User 7"
},
Category: "Category 8"
},
{
Created: Date(2024, 09, 01),
Title: "Course 9",
course_description: "Automating tasks with AI Builder.",
Used: false,
User: {
UserEmail: "usuario_generico8@ejemplo.com",
DisplayName: "Generic User 8"
},
Category: "Category 9"
},
{
Created: Date(2024, 06, 20),
Title: "Course 10",
course_description: "Introduction to Power Platform governance.",
Used: true,
User: {
UserEmail: "usuario_generico9@ejemplo.com",
DisplayName: "Generic User 9"
},
Category: "Category 10"
},
{
Created: Date(2024, 05, 30),
Title: "Course 11",
course_description: "Creating user-friendly interfaces.",
Used: false,
User: {
UserEmail: "usuario_generico10@ejemplo.com",
DisplayName: "Generic User 10"
},
Category: "Category 11"
},
{
Created: Date(2024, 04, 25),
Title: "Course 12",
course_description: "Integrating with external data sources.",
Used: true,
User: {
UserEmail: "usuario_generico11@ejemplo.com",
DisplayName: "Generic User 11"
},
Category: "Category 12"
},
{
Created: Date(2024, 03, 10),
Title: "Course 13",
course_description: "Deploying solutions in Power Apps.",
Used: false,
User: {
UserEmail: "usuario_generico12@ejemplo.com",
DisplayName: "Generic User 12"
},
Category: "Category 13"
},
{
Created: Date(2024, 02, 10),
Title: "Course 14",
course_description: "Managing Power Apps environments.",
Used: true,
User: {
UserEmail: "usuario_generico13@ejemplo.com",
DisplayName: "Generic User 13"
},
Category: "Category 1"
},
{
Created: Date(2024, 01, 25),
Title: "Course 15",
course_description: "Advanced customizations in Power Apps.",
Used: false,
User: {
UserEmail: "usuario_generico14@ejemplo.com",
DisplayName: "Generic User 14"
},
Category: "Category 2"
},
{
Created: Date(2024, 04, 15),
Title: "Course 16",
course_description: "Understanding Power Apps licensing.",
Used: true,
User: {
UserEmail: "usuario_generico15@ejemplo.com",
DisplayName: "Generic User 15"
},
Category: "Category 3"
},
{
Created: Date(2024, 05, 20),
Title: "Course 17",
course_description: "Creating efficient workflows.",
Used: false,
User: {
UserEmail: "usuario_generico16@ejemplo.com",
DisplayName: "Generic User 16"
},
Category: "Category 4"
},
{
Created: Date(2024, 06, 10),
Title: "Course 18",
course_description: "Using templates for quick development.",
Used: true,
User: {
UserEmail: "usuario_generico17@ejemplo.com",
DisplayName: "Generic User 17"
},
Category: "Category 5"
},
{
Created: Date(2024, 07, 25),
Title: "Course 19",
course_description: "Exploring Power Apps mobile capabilities.",
Used: false,
User: {
UserEmail: "usuario_generico18@ejemplo.com",
DisplayName: "Generic User 18"
},
Category: "Category 6"
},
{
Created: Date(2024, 08, 15),
Title: "Course 20",
course_description: "Integrating Power Apps with Teams.",
Used: true,
User: {
UserEmail: "usuario_generico19@ejemplo.com",
DisplayName: "Generic User 19"
},
Category: "Category 7"
}
)
);
ClearCollect(
Categories,
Table(
{Index: 1, Category: "Category 1"},
{Index: 2, Category: "Category 2"},
{Index: 3, Category: "Category 3"},
{Index: 4, Category: "Category 4"},
{Index: 5, Category: "Category 5"},
{Index: 6, Category: "Category 6"},
{Index: 7, Category: "Category 7"},
{Index: 8, Category: "Category 8"},
{Index: 9, Category: "Category 9"},
{Index: 10, Category: "Category 10"},
{Index: 11, Category: "Category 11"},
{Index: 12, Category: "Category 12"},
{Index: 13, Category: "Category 13"}
)
);
Set(currentCategoryIndex, 1);
Set(currentCategory, LookUp(Categories, Index = currentCategoryIndex).Category)
If my response resolved your issue, please feel free to mark it as the solution by clicking "Accept as solution." This helps others find the answer more easily. If you found the content helpful in any other way, a "Thumbs Up" would be greatly appreciated. Thank you! 😁