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 Apps / Custom Submit Button N...
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
    )
);

 
Categories:
I have the same question (0)
  • AK-03091416-0 Profile Picture
    9 on at
    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

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard