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 / App Run on Start - Not...
Power Apps
Answered

App Run on Start - Not working consistently

(0) ShareShare
ReportReport
Posted on by 70

Hello,

 

I have a code on the App on start as 

 

Concurrent(
ClearCollect(VarCollection11, Filter('Wheeler Docs', NumList >= 1 && NumList <= 2000)),
ClearCollect(VarCollection22, Filter('Wheeler Docs', NumList >= 2001 && NumList <= 4000));ClearCollect(VarCollection33, Filter('Wheeler Docs', NumList >= 4001 && NumList <= 6000));ClearCollect(VarCollection44, Filter('Wheeler Docs', NumList >= 6001 && NumList <= 8000));ClearCollect(VarCollection55, Filter('Wheeler Docs', NumList >= 8001 && NumList <= 10000)));
ClearCollect(CollectR, VarCollection11, VarCollection22,VarCollection33,VarCollection44,VarCollection55 )

 

Then i have form where i input a contract id value and search with a button and search will retreive rest of the field values from sharepoint .

 

When i search for a particular contract id which i know exists in sharepoint, it doesn't return anything , but when i manually run the app on start again i search the results are returned . When i publish the app to users i dont expect users asking me to run the app on start each time.

 

Search form

bsoleti_0-1607997626415.png

 

Search Contract Button Code

UpdateContext({AppIDVar:First(Filter(CollectR,ContractNumber=TextInput1_ContractID_1.Text)).ApplicationNumber});
UpdateContext({CustomerNameVar:First(Filter(CollectR,ContractNumber=TextInput1_ContractID_1.Text)).CustomerName});
UpdateContext({DocSourceVar1:First(Filter(CollectR,ContractNumber=TextInput1_ContractID_1.Text)).SourceSystem});
UpdateContext({BPNVar:First(Filter(CollectR,ContractNumber=TextInput1_ContractID_1.Text)).BPN});
UpdateContext({TINVar:First(Filter(CollectR,ContractNumber=TextInput1_ContractID_1.Text)).TIN});

 

 

Please advise on the resolution.

 

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    @bsoleti ,

    Firstly, there is nothing wrong with your code that I can see, except I would probably drop the Concurrent to see if that makes a difference. You might also try running it at Screen OnVisible instead.

    Concurrent(
     ClearCollect(
     VarCollection11, 
    	 Filter( 
     'Wheeler Docs', 
     NumList >0 && NumList < 2001
     )
     ),
     ClearCollect(
     VarCollection22, 
     Filter(
     'Wheeler Docs', 
     NumList > 2000 && NumList < 4001
     )
     );
     ClearCollect(
     VarCollection33, 
     Filter(
     'Wheeler Docs', 
     NumList > 4000 && NumList < 6001
     )
     );
     ClearCollect(
     VarCollection44, 
    	 Filter(
     'Wheeler Docs', 
     NumList > 6000 && NumList < 8001
     )
     );
     ClearCollect(
     VarCollection55, 
     Filter(
     'Wheeler Docs', 
     NumList > 8000 && NumList < 10001
     )
     )
    );
    ClearCollect(
     CollectR, 
     VarCollection11, 
     VarCollection22,
     VarCollection33,
     VarCollection44,
     VarCollection55
    )

    The other part could also be tidied up as below

    With(
     {
     wContract:
     Lookup(
     CollectR,
     ContractNumber=TextInput1_ContractID_1.Text
     )
     },
     UpdateContext(
     {
     AppIDVar:wContract.ApplicationNumber,
     CustomerNameVar:wContract.CustomerName,
     DocSourceVar1:wContract.SourceSystem,
     BPNVar:wContract.BPN,
     TINVar:wContract.TIN
     }
     )
    )

     

    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.

  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    Hi @bsoleti ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

  • bsoleti Profile Picture
    70 on at

    Hi Warren,

     

    So far seems to be working with your suggestion as i moved the collection code to screen visible , i am still testing further.

     

    Thanks for your help as a;ways

  • Verified answer
    WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    Thanks @bsoleti ,

    Also running Concurrent trying to do six collections from the same data source also is something I would not attempt and it is well worth (in my humble opinion anyway) taking the small performance hit to ensure you get all the data.

     

    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.

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard