Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Custom Submit Button Not Working

(2) ShareShare
ReportReport
Posted on by 9

Hello,

I built a Power App that helps track and schedule hours needed for a project manager to complete a project. Currently, the submit button takes entries from a nested gallery and patches them into Dataverse tables. It was running perfectly for quite some time, but now it has run into issues where it stops working. I hoping to get help with this issue. Below, I have listed the circumstances where the button stops working and does not allow a user to submit their entries:

  1. Only the first entry has been placed, and the submit button is clicked (see attached image).
    1. Adding one entry, not clicking out of the entry box and then clicking submit
  2. hanging the first entry to 0 and clicking the submit button if no new data has been entered in the gallery.
  3. Clicking the submit button if no new data has been entered in the to gallery
Here is the code for the button and an OnTimerEnd function that is supposed to be triggered after the button is done. 
 
//Submit Button

//Turn on load spinner
Set(VarPopup, true);

// Clear collection for new entries 
Clear(colEntryHours);

//Collect new entries from gallery and nested gallery
ForAll(
    EntryGal.AllItems As NewEntry,
    ForAll(
        NewEntry.WeekAndInputGallery.AllItems As NestedEntry,
        Collect(
            colEntryHours,
            {
                cr65f_projectid: Project_Gallery.Selected.ProjectID,
                cr65f_projectidManager: Project_Gallery.Selected.ProjectManager,
                cr65f_Task: NewEntry.TaskName.Text,
                cr65f_DateSubmitted: NestedEntry.StartofWeekGalleryDate.Text,
                cr65f_Entry: NestedEntry.HoursInput.Text
            }
        )
    )
);

//Update or replace vaules in Capacity Hours table with entries from collection
ForAll(
    colEntryHours,
    If(
        !IsBlank(cr65f_Entry),
        Patch(
            Capacity_Hours,
            If(
                IsBlank(
                    First(
                        Filter(
                            Capacity_Hours,
                            ProjectID = cr65f_projectid && DateSubmitted = cr65f_DateSubmitted && Task = cr65f_Task
                        )
                    )
                ),
                Defaults(Capacity_Hours),
                First(
                    Filter(
                        Capacity_Hours,
                        ProjectID = cr65f_projectid && DateSubmitted = cr65f_DateSubmitted && Task = cr65f_Task
                    )
                )
            ),
            {
                ProjectID: cr65f_projectid,
                ProjectManager: cr65f_projectidManager,
                Task: cr65f_Task,
                DateSubmitted: cr65f_DateSubmitted,
                Entry: cr65f_Entry
            }
        )
    )
);

Reset(LoadColTimer);
Set(StartTimer, true);

Set(
    VarEntryTotal,
    Sum(
        Filter(
            FilteredCollection,
            DateValue(cr65f_datesubmitted) >= DateAdd(
                Today(),
                0 - Weekday(Today(), StartOfWeek.Sunday)
            )
        ),
        If(IsBlank(cr65f_entry) Or Not(IsNumeric(cr65f_entry)), 0, Value(cr65f_entry))
    )
);

LoadColTimer.AutoStart = StartTimer;
Set(VarPopup, false);



_______________________________________________________________________________________________________


//OnTimerEnd separate from button

Clear(colEntryErrorTrack);
// Clear the collection first
ForAll(
    EntryGal.AllItems As NewEntry,
    ForAll(
        NewEntry.WeekAndInputGallery.AllItems As NestedEntry,
        Collect(
            colEntryErrorTrack,
            {
                Project: Project_Gallery.Selected.ProjectID,
                ProjectManager: Project_Gallery.Selected.ProjectManager,
                Task: NewEntry.TaskName.Text,
                DateSubmitted: (NestedEntry.StartofWeekGalleryDate.Text),
                Entry: NestedEntry.HoursInput.Text
            }
        )
    )
);
Clear(colEntryHours);
Set(StartTimer, false);
//Need to create a collection of the Entered Capacity Hours for each task so that it can be used in calculations 
ClearCollect(
    FilteredCollection,
    ShowColumns(
        Filter(
            Capacity_Hours,
            ProjectID = Project_Gallery.Selected.ProjectID
        ),
        ProjectID,
        Task,
        Entry,
        DateSubmitted
    )
);

 
  • AK-03091416-0 Profile Picture
    9 on at
    Custom Submit Button Not Working
    UPDATE: 

    I notice that when I have a singular entry in the upper left box (App Snip image) the colEntryHours does not collect that value, but when a second value is place below on the next task row it collects both values. For some reason the first row of the nested gallery does not get collected, it is only when the second row has entries that the first row will be collected. (New App Snip image below).
     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,700 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard