cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
C_Baugher
Frequent Visitor

onStart - Collection Not Popualting

I seem to be running into an issue with my onStart - formula is below. When I run the onStart within the builder/editor (manually), it works perfectly. When I go ahead and have my test user run the app, it appears as though the collection is not populating. The table it is calling in SP is open to all my users with read access, and is only 115 rows, so I don't think I'm running into limits. When I run the monitor on the user it simply says 'success' but zero rows returned. I went ahead and turned off use non-blocking onstart rule as recommended in some other threads but the issue persists. I also tried throwing it on onVisible but the net result is the same. I'm basically just importing that to a local table to switch languages for folks.

 

 

// Set employee email to avoid delegation.
Set(
    employeemail,
    Lower(User().Email)
);
// Set today's date to avoid delegation.
Set(
    vartoday,
    Today()
);
// Import translation Table.
ClearCollect(
    TranslationTable,Translation
);
// Get Language and Set variable.
Set(
    userlang,
    Language()
);
// Language 2 letter code.
Set(
    userlangshort,
    If(
        "-" in userlang,
        Left(
            userlang,
            Find(
                "-",
                userlang
            ) - 1
        ),
        userlang
    )
);
// Final language code
Set(
    userlanguagefinal,
    Coalesce(
        LookUp(
            TranslationTable,
            userlangshort = Title
        ).Title,
        "en"
    )
);
// Load if available - response
ClearCollect(
    existingid,
    Filter(
        'FLHA Responses V2',
        employeemail = 'Created By'.Email And 'Submission Date' = Date(
            Year(vartoday),
            Month(vartoday),
            Day(vartoday)
        )
    )
)

 

12 REPLIES 12
WarrenBelz
Super User
Super User

Hi @C_Baugher ,

Try this

Set(varUser,User());
ClearCollect(
   existingid,
   Filter(
      'FLHA Responses V2',
      employeemail = varUser.Email &&
      IsToday('Submission Date')
   )
)

 

Please click Accept as solution 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 Thumbs Up.

RandyHayes
Super User
Super User

@C_Baugher 

Your issue is most likely with the date.  If the Submission Date includes a time, then you will need to exactly match that time.  If it does not include the time, then you might be dealing with a TimeZoneOffset in the comparison due to the Regional Settings on your SharePoint list.

 

I would research those first.

 

Beyond that my only other suggestion would be to get rid of the collections and combine this into one variable for easier maintenance.  

 

So, check the column definition for Submission Date and the regional setting for your SharePoint site.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It's the first collection, not the second one. The second one is behaving as expected, I think!

 

ClearCollect(
    TranslationTable,Translation
);

 

RandyHayes
Super User
Super User

@C_Baugher 

What is Translation?  If you put your cursor on that in the formula editor, does it show records?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Translation is my datasource - it's a SP List (has 115 rows which is below any threshold I think). When I dot walk it, it does show the columns, so I think that is connected correctly. The collection does show when I manually run the onstart in papps editor - I go to collections -> TranslationTable -> and I can see five preview items. 

RandyHayes
Super User
Super User

@C_Baugher 

Click on the Translation in the formula editor and then click on the down arrow in the bottom formula bar.

RandyHayes_0-1616514374194.png

See what that shows you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Huh, weird, okay, so when I do that it says "we didn't find any data". The list definitely has data, and I don't fully understand why the collection shows data if there isn't data to show? I went ahead and recreated the connection with a rename just in case that was part of the issue.

 

2021-04-21 17_19_34-FLHA - Saved (Unpublished) - Power Apps.png2021-04-21 17_19_50-FLHA - Saved (Unpublished) - Power Apps.png

RandyHayes
Super User
Super User

@C_Baugher 

So in your original formula you had Translation, now you are showing TranslationTerms.  

Is that of any significance?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Naw, I literally just renamed the list, removed the connection and readded it, just in case it was something funky with the name. Just a troubleshooting step.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,014)