Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

How to prevent a collection being wiped when exiting the app to continue progress

(1) ShareShare
ReportReport
Posted on by 28
I have built a Employee Time Entry app which as the user is entering each day it is added to a collection and they have a screen where they can review these entries in a gallery and when happy they submit it to a SharePoint list.  Some of the feedback I have been given is the users want to be able to enter a day and have the ability to exit the app then go in again next day to enter the following one but want to be able to see the previous day(s) too all before actually submitting anything to the SharePoint list.
 
From what I gather so far I need to set up another (in progress) SharePoint list with the same columns so they can save each day as they go but when they come back into the app need it to populate the collection with the previous data.  I think I need to have some formula in the OnStart property of APP but I'm unsure the correct formula to set this up to do this.  How can I do this?  They need to be able to add to this without wiping any existing data then once their full week is in there they can submit to the final SharePoint list.  they also need to only see their own data.
 
I can have an automation which archives the in progress data once the data has been submitted to the final list.  
  • CRam3b92 Profile Picture
    CRam3b92 28 on at
    How to prevent a collection being wiped when exiting the app to continue progress
    @Hack-7
     
    I need to have separate list as the information is only to be submitted to the main list once employees are happy with it and finally submit there but the issue that was raised was that they want to be able to add a day, and log back into the app to continue progress and only submit at the end of the week.
     
    Thanks for replying
  • CRam3b92 Profile Picture
    CRam3b92 28 on at
    How to prevent a collection being wiped when exiting the app to continue progress
    Apologies for posting twice the site keeps playing up for me as think Microsoft are updating it
  • CRam3b92 Profile Picture
    CRam3b92 28 on at
    How to prevent a collection being wiped when exiting the app to continue progress
    Hi @WarrenBelz
     
    I have added this in to the OnStart property for APP but when I add a record into the app first post it to my InProgress list, exit the app and then when I go back in the record that was posted doesn't show in the gallery linked to the collection.  The record is showing in my list but it just doesn't seem to pull back to the collection.
     
    I have some other formula already on the OnStart property of the app to add side menu, variable for the user and collection for working with time in the app and finally this new one I need at the bottom.  Do I need to structure my full formula differently to get this to work?  Formula below:
     
    ClearCollect(
        colMenu,
        Table(
        {
            MenuLabel: "Home",
            MenuIcon: Icon.Home,
            MenuScreenNavigation: HomeScreen,
            MenuID: 1
        },
        {
     
            MenuLabel: "New Time Entry",
            MenuIcon: Icon.DocumentWithContent,
            MenuScreenNavigation: NewTimeEntry,
            MenuID: 2
        },
        {
            MenuLabel: "View Time Entries",
            MenuIcon: Icon.DetailList,
            MenuScreenNavigation: ViewTimeEntries,
            MenuID: 3
        },
        {
            MenuLabel: "Support",
            MenuIcon: Icon.Support,
            MenuScreenNavigation: Support,
            MenuID: 4
        }
    )
    );
    Set(varUser, User().Email);
    ForAll(Sequence(24,0), Collect(colHour, {Value: Text(ThisRecord.Value, "[$-en-US]00")}));
    ForAll([0,15,30,45,60], Collect(colMinutes, {Value: Text(ThisRecord.Value, "[$-en-US]00")}));
     
    ClearCollect(
        colTimeEntryWeek,
    'TimeEntry-InProgress'
    )
  • CRam3b92 Profile Picture
    CRam3b92 28 on at
    How to prevent a collection being wiped when exiting the app to continue progress
    .
  • Hack-7 Profile Picture
    Hack-7 203 on at
    How to prevent a collection being wiped when exiting the app to continue progress
    As Warren said you will need to collect the data from a list, but I would not complicate things with having a 2nd - In progress list.  Just add a new column which will track Status.  
     
    Then you will be able to filter by Employee and Status to see 'In Progress' or 'Completed'.  Having 2 list will complicate the logic and then you will need to start using AddColumns(), ShowColumns() and LookUp() in the collection.
     
    Just my .02$
    Cheers
  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    How to prevent a collection being wiped when exiting the app to continue progress
    Hi  ,
    You are on the right track - you simply need to collect the data from your list
     
    ClearCollect(
       YourCollection,
       YourListName
    )

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard