cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Joppel
Helper I
Helper I

Validate Sharepoint list value on start

We have a problem with a filter for the start screen. When we run Onstart to test the validation, everything works as it should. when the app is published the validation does not work. We think it has to do with the fact that the data we want to validate is not yet available at startup, but how could we solve this? We use the code below:

 

 

If(
    And(
        CountRows(Gallery_1.AllItems) = 0 Or DateDiff(
            DateTimeValue(First(Gallery-1.AllItems).Created),
            Today(),
            Days
        ) >= 28,
        Value(LookUp('Sharepointlist',Value_1=Profitvalue.Text,Profit))>=100000
    ),
    Profitscreen,
    Startscreen
)

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Joppel ,

 

You could just copy the formulas from Items of the Gallery_1 to replace Gallery_1.AllItems that in OnStart. The Timer Control is no more needed.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
fuzzy_fuzz
Resolver II
Resolver II

I'm thinking on placing a 500ms or so Timer that starts on the OnStart. Then at OnTimerEnd execute your code.

If you think the issue comes from not having the data at the Start moment a delay should solve it.

Joppel
Helper I
Helper I

We've built in a timer, but to make sure the data is loaded, we set it to 5 seconds.

For now we achieve what we wanted, but if someone knows how we can load this faster, we'd love to hear about it.

v-jefferni
Community Support
Community Support

Hi @Joppel ,

 

You could just copy the formulas from Items of the Gallery_1 to replace Gallery_1.AllItems that in OnStart. The Timer Control is no more needed.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,552)