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 Apps
Answered

Delay and Patch

(0) ShareShare
ReportReport
Posted on by 205

I have an app that has 2 buttons - One button to collect data and one button saves the data back to the sharepoint datasource.  The information that is collected is based on a gallery select item, then text inputs look-up the values associated with the selected item.  My issue is....when pressing the button, the values for the textboxes are not always there when the collection is gathered.  I assume that it's a timing issue because when I execute the button several times in a row, the collection is successful, or if I press the button for 2 or more seconds, the collection is there.   Is there a way to delay the button to allow the text inputs to populate?  I have tried a timer, but I don't understand how to attach it to the button.

Capture.JPG

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @TerrificTerri 

    That seems like a strange behaviour.  There is no delay in values being in the controls that you would have to account for...unless you have some type of formula on them that will be performing a looking.

    So, rather than try to account for that, could you consider changing how you are collecting the information?

    You say that "the information is collected based on a gallery selected item, then text inputs look-up the values associated with the selected item" Perhaps consider having the information you need already in the selected item.  Then your text inputs would simply be Galleryx.Selected.columnName and your Update formula on the button could be Collect(AllResponses, {'Assistant1 Response': ThisItem.columnName, ....

    I find in most all of our apps that going to the datasource once for what you want (all of it...as much as possible) is better on little issues like that.

     

    I hope that helps a bit.

     

  • TerrificTerri Profile Picture
    205 on at

    @RandyHayes The lookup values are coming from a different list.  Thank you so much for your response.  

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @TerrificTerri 

    So again, you can still bring those into your Gallery in the Items property...they would be there then.

    Otherwise, consider changing your update OnSelect to use the same lookup associated with the text input rather than the text input control itself.

    So in other words (or formulas) -  Collect(AllResponses, {'Assistant1 Response': theLookupFormulaYouHaveOntxtAssistant1Response, ....

     

    Personally, I like getting them at the time of Gallery load, only because then there is only 1 formula for the lookup to be maintained.

       Gallery Items:  AddColumns(yourOriginalItemsDataSource, "Assistant1Response", theLookupFormulaYouHaveOntxtAssistant1Reponse, "Assistant2Reponse", the LookupFormulaYoHaveOntxtAssistant2Reponse, ....

     

    Then, your text input for Assistant1 Reponse would be Galleryx.Selected.Assistant1Response, and so on.

    Your OnSelect on the button would be Collect(AllReponses, {'Assistant1 Reponse':ThisItem.Assistant1Response, ...

     

    This could (theoretically) marginally slow down the initial Gallery load (although I have yet to see any impact from it). But it sure is nice to have good data "in hand" rather than going back to get it and dealing with the delay.

  • TerrificTerri Profile Picture
    205 on at

    @RandyHayes POW  Right between the eyes!  Totally awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard