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

Community site session details

Session Id :
Power Pages - Power Apps Portals
Suggested answer

Auto Task assignments in power apps- Issue

(1) ShareShare
ReportReport
Posted on by
Hey Power Apps Engineers , 
Greetings , 
 
I have an power app application that will distribute all files to multi selected employees with generating tasks numbers and store it in database . once I click on submit button all the files are assigned only to one user not to the whole selected employees based on the selected station and rec type. I need to make all the solution in power apps 
 
I'm seeking your support as It's not working anyway . 
 
Looking forward for your response ASAP.
 
Thank you & Best regards, 
Categories:
I have the same question (0)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,215 Super User 2025 Season 2 on at
    Auto Task assignments in power apps- Issue
     

    Hi! Thanks for reaching out, and you're definitely on the right track. It sounds like your Power Apps app is designed to:

    • Distribute files to multiple selected employees.
    • Generate task numbers for each assignment.
    • Store everything in a database.
    • But currently, it only assigns files to one user, even when multiple are selected.

    Let’s troubleshoot and guide you toward a working solution.


     Common Cause of Your Issue

    In Power Apps, when you use a Gallery or ComboBox to select multiple users, you need to loop through each selected user and perform the assignment logic individually.

    If you're only assigning to one user, it’s likely that your Submit button is only processing the first item in the selection, or not looping at all.


     Suggested Fix: Use a ForAll() Loop

    Here’s how you can structure your logic in Power Apps:

     

    ForAll(

        ComboBoxEmployees.SelectedItems,

        Patch(

            TasksTable,

            Defaults(TasksTable),

            {

                Employee: ThisRecord,

                TaskNumber: Text(Now(), "yyyymmddhhmmss") & Text(Rand()*1000),

               FileReference: SelectedFile,

                Station: SelectedStation,

                RecType: SelectedRecType

            }

        )

    )

    🔍 Explanation:

    • ComboBoxEmployees.SelectedItems: the list of selected employees.
    • ForAll(...): loops through each selected employee.
    • Patch(...): creates a new record in your database (e.g., Dataverse or SharePoint).
    • TaskNumber: generates a unique task number using timestamp and random digits.

     Next Steps

    1. Confirm your ComboBox is set to allow multiple selections:

      • ComboBoxEmployees.SelectMultiple = true
    2. Ensure your database (e.g., SharePoint or Dataverse) can store multiple assignments:

      • Each task should be a separate row with a reference to the employee and file.
    3. Test with 2–3 employees selected and verify that multiple records are created.

    🏷️ Tag me if you have any further questions or if the issue persists.
    ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
    ❤️ Give it a Like if you found the approach useful in any way.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 48 Super User 2025 Season 2

#3
KevinGador Profile Picture

KevinGador 44 Super User 2025 Season 2