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 / Gallery not refreshing...
Power Apps
Unanswered

Gallery not refreshing after submitting

(1) ShareShare
ReportReport
Posted on by 45
I created a booking system in power apps, and t worked pretty well, with a form you can book spaces in a schedule
 
when the formed was filled the gallery was updated automatically with the booked slot, but then it suddenly stopped working, it refreshes until I click on the date. I don't know what happened.
Categories:
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at
    What is the Items of the gallery and what is the code you are using to update the data (and where are you doing this from)? Please post all of this in Text.
  • BL-19081749-0 Profile Picture
    45 on at
    @WarrenBelz It's quite complicated because it has many conditions
     
    on the gallery Items I have this:
     
    If( Strng2.Text = "N",
    
    // If is monday ///
    (If(Weekday(gvDateSelect) = 2,
    Filter(colCalendarFinal,ValueInt > 400),
    
    /// If i saturday ///
    If(Weekday(gvDateSelect) = 7,
    Filter(colCalendarFinal,ValueInt < 400),
    
    /// If is sunday ///
    If(Weekday(gvDateSelect) = 1, Filter(colCalendarFinal,0),
    
    
    /// If any other day ///
    colCalendarFinal)))),
    
    (
       // IF BETWEEN //
    
    
       If( gvDateSelect > DateValue(startDateLbl.Text) And gvDateSelect < DateValue(endDatelbl.Text),
       Filter(colCalendarFinal, 0),
    
       // START DATE //
    
       If( gvDateSelect > DateValue(startDateLbl.Text) And (Weekday(gvDateSelect) = 1 And Weekday(gvDateSelect) = 2 And Weekday(gvDateSelect) = 7),
       Filter(colCalendarFinal,0),
    
       If( gvDateSelect = DateValue(startDateLbl.Text) And (Weekday(gvDateSelect) > 2 And Weekday(gvDateSelect) < 7),
       Filter(colCalendarFinal, ValueInt < 420),
       
       If( gvDateSelect = DateValue(startDateLbl.Text) And Weekday(gvDateSelect) = 7,
       Filter(colCalendarFinal, ValueInt <420)
       ,
       
       If( gvDateSelect = DateValue(startDateLbl.Text) And Weekday(gvDateSelect) = 2,
       Filter(colCalendarFinal,0)
       ,
    
       // END DATE //
    
       If( gvDateSelect = DateValue(endDatelbl.Text) And (Weekday(gvDateSelect) > 1 And Weekday(gvDateSelect) < 6),
       Filter(colCalendarFinal, ValueInt >= 420),
    
       Filter(colCalendarFinal, 0)))))))))
    
    
    This because it should show available schedules according to the day of the week. When I click on "+ Agregar cita" it shows a prefilled form where I can schedule some employee, in the past it appeared automatically on the gallery as a scheduled space, but like 2 days ago it stopped working unless I click on the same day
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at
    My next question before we go any further is when and how you are updating colCalendarFinal as that is what the Gallery is filtered on.
  • BL-19081749-0 Profile Picture
    45 on at
    I'm afraid I am not understanding the question :S
     
    @WarrenBelz
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at
     Mean that the calendar is sourced from the collection, therefore that needs to be updated to allow the calendar to refresh. When and how are you doing this ?
  • BL-19081749-0 Profile Picture
    45 on at
    It supposed to update the gallery when triggering the button of the form where only Submit function is executed. Not sure which information you mean but I reffer to the OnVisible codes that I have, I don't know If that would work. Also, as I mentioned, This was working well but it suddenly stopped working, I don't know why, even If I refresh the data base manually from the data sets menu, it is not updating the gallery, unless I click on any gallery button, same for deleting values (I have a button of a trashcan with the Remove function)
     
    @WarrenBelz
     
    
    
    ///***vis pop ups***///
    
    Set(visPOP_1,false);
    Set(visPOP_2,false);
    
    ///****nueva cita fields sets***///
    Set(visDropTime1,false);
    Set(butText,"ᐯ");
    Set(startTextCopy,"");
    Set(trigger_Add, 0);
    
    //****edit cita fields sets***///
    Set(visDropTime2,false);
    Set(butText2,"ᐯ");
    Set(startTextCopy2,"");
    Set(copyNoEmp,"");
    Set(copyName,"");
    Set(copyPlant,"");
    Set(copyDate,"");
    Set(copyID,Value(""));
    
    //---REFRES DATA BASES---//
    Refresh(DaysOff);
    Refresh(Hc_DataBase);
    
    
    
    Select(icoToday);
    
    // Build colCalendarDraft - structure for times by 30 minutes and row numbers
    With(
        {
            tvBlankSchedule: AddColumns(
                // Initial 15 minute Time output
                (Filter((ForAll(Sequence(48),Time(0, 30 * (Value - 1), 0))),Value < Time(16,30,0) Or Value > Time(22,0,0) Or Value < Time(0,0,0)))
                ,
                // Add column with Minute value for current Time less Midnight
                ValueInt,
                DateDiff(
                    TimeValue("12:00 AM"),
                    Value,
                    TimeUnit.Minutes
                )
            )
        },
        // Build collection based off output from With statement, add Row No logic
        ClearCollect(colCalendarDraft,
          ForAll(
            Sequence(CountRows(tvBlankSchedule)),
            Patch(
                Index(tvBlankSchedule, Value),
                {RowNo: Value}
            )
        ))
    );
    
    Concurrent(
        // Capture today's date
        Set(gvDateToday, Today()),
        // Use Today's date capture to set additional var
        Set(gvDateSelect, Today())
    );
    
    With(
        {
            // Build a temp tbl; appointments for selected date
            tvAppointments: Filter(
                Incoming_PSY,
                DateValue(DateApp) = gvDateSelect
            )
        },
        ClearCollect(
            // Create finalised collection
            colCalendarFinal,
            AddColumns(
                colCalendarDraft,
            // Add appointment column, using output of With()
                Appointment,
                tvAppointments
                )
            )
        );
    
    
    /// color botones radio ///
    
    Set(colorDay, RGBA(189,219,219,1));
    Set(colorNight,RGBA(189,219,219,1));
    
    Set(shiftValue,"");
    
     
     
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at
    If that is the Screen OnVisible code, then it is only going to run if you exit and re-enter the screen. I see you are collecting colCalendarFinal in there, so if you want the gallery to refresh without re-entering the screen, you will either need to re-collect or (better option) Patch the collection with any updated data as the Form submission will be writing directly to the data source, not the collection on which the calendar is based. The best place to do this would be OnSuccess of the Form.
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • BL-19081749-0 Profile Picture
    45 on at
    @WarrenBelz

    How to patch it in the on success? I currently have only Refresh of the database 
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at
    Put the Patch code on the OnSuccess property of the Form.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard