web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / open/close work sessio...
Power Apps
Answered

open/close work session app

(0) ShareShare
ReportReport
Posted on by 453
Hello - hoping someone can advice on how to build an app to start and end tasks.
 
My app has two dropdowns, name and task. Then i have a start task button and an end task button.
 
I want my app to only allow users to have one open task at a time, so if they begin a task and close the app, when they re-open and attempt to start a new one, or even end a task they havent started yet, to not allow them to proceed.
 
When the start task button is selected, a sharepoint item is created. When end task is selected, that record will be patched with the date and time.
 
I have a sharepoint list which will store name, task, status ('in progress', 'task complete'), start time, end time. 
 
Note, it will be a service account logged into the app, so the dropdown for name is required. 
 
 
Any help appreciated!
 
Thanks
Categories:
I have the same question (0)
  • Verified answer
    SwatiSTW Profile Picture
    809 Super User 2026 Season 1 on at
    @Jap11
    I feel if you follow below steps/logic it can help you
     
    BUILD TASK TRACKER APP – ACTION STEPS
    1. Set up SharePoint List
    Columns:
    Name (Text)
    Task (Text or Choice)
    Status (Choice: "In Progress", "Task Complete") - this is important
    StartTime (DateTime)
    EndTime (DateTime)

    2. Dropdowns in Power Apps
    drpName.Items
    ["Alice", "Bob", "Charlie"] - name of your users

    drpTask.Items
    ["Task A", "Task B", "Task C"]  - tasks name
     
    3. Start Task Button (btnStartTask.OnSelect)
    If(
        CountRows(
            Filter(
                YourSharePointList,
                Name = drpName.Selected.Value && Status = "In Progress"
            )
        ) > 0,
        Notify("Task already in progress", NotificationType.Error),
        Patch(
            YourSharePointList,
            Defaults(YourSharePointList),
            {
                Name: drpName.Selected.Value,
                Task: drpTask.Selected.Value,
                Status: "In Progress",
                StartTime: Now()
            }
        )
    )
     
    4. End Task Button (btnEndTask.OnSelect)
    Set(
        openTask,
        First(
            Filter(
                YourSharePointList,
                Name = drpName.Selected.Value && Status = "In Progress"
            )
        )
    );
    If(
        IsBlank(openTask),
        Notify("No active task to end", NotificationType.Error),
        Patch(
            YourSharePointList,
            openTask,
            {
                Status: "Task Complete",
                EndTime: Now()
            }
        )
    )
     
    5. Disable Buttons Based on Task Status
    Start Task Button – DisplayMode:
    If(
        CountRows(
            Filter(YourSharePointList, Name = drpName.Selected.Value, Status = "In Progress")
        ) > 0,
        DisplayMode.Disabled,
        DisplayMode.Edit
    )

    End Task Button – DisplayMode:
    If(
        CountRows(
            Filter(YourSharePointList, Name = drpName.Selected.Value, Status = "In Progress")
        ) = 0,
        DisplayMode.Disabled,
        DisplayMode.Edit
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard