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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Auto Task assignments ...
Power Pages
Suggested Answer

Auto Task assignments in power apps- Issue

(1) ShareShare
ReportReport
Posted on by 2
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,827 Super User 2025 Season 2 on at
     

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 74 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard