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 / SQL server relation sl...
Power Apps
Unanswered

SQL server relation slave field edit updating so slow that on submit de wrong data is stored

(0) ShareShare
ReportReport
Posted on by 711

I have a standard record edit form to edit shelter animals in a table in a microsoft sql database through powerapps.

Beside fields that can be edited normally there are relation slave fields:

There is a field species_id that contains a number referring to the master in a species table.

Let us say 1 is dog, 4 is rabbit.

I have changed the form the way various tutorials suggest: for such a field delete the edit from the datacard and replace it with a dropdown.

All works perfectly.

Sometimes however you I see the slave field waiting 1 or 2 seconds to catch up. It first says dog and after some seconds it says rabbit, like it should.

If I change some other normal field like chip numver and sumbit quickly my rabbit has become a dog.

How do I prevent this?

 

 

Categories:
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @HansHeintz , 

     

    Sometimes, data takes 1-2 seconds to load, that totally depends on how fast your connection can retrieve the data and the amount of data inside your sql table. As a work around for this, can you please do a reset of the label that you are using for showing the name? This can be done onChange property of the dropdown control.  With this, while the data is getting loaded, you can show a blank value in the label and once this is loaded properly, it will reflect the reurned result. If you could share a snippet, we can look for something that can optimize your approach.
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @HansHeintz ,

    Do you mean that the delay of uploading data will lead to store wrong data?

    The issuse is mainly caused by connection itself. I'm afraid you can't avoid it directly.

    Here are two tips for you:

    Firstly, I suggest you optimize your formula. If you are convinent, you could show it and let me see. Maybe I could help you.

    Secondly, I suggest you use the Timer control.

    Set its Duration and OnTimerEnd to increase waiting time.

    For example, set its duration to 5 seconds and OnTimerEnd to submit form. And then, the form will wait for 5 more seconds before submitting the form.

    Here's a doc about Timer for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-timer

     

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

  • HansHeintz Profile Picture
    711 on at

    Hi,

     

    Yes wrong data is stored if I go too quick.

     

    I give an example of the code for the most complicated field: breed (ras in dutch)

    In dutch coding ; is used in stead of ,

     

    On a datacard of the breed (ras) field of table animals (dieren) I remove the text input control.

    I instead put a dropdown.

    I set the items property of the dropdown to
    Filter('[dbo].[ras]';diersoort_id=Value(Label3.Text))

    (I do this so only the breeds are shown that are compatible with the species (diersoort))

    I set the default value of the dropdown to

    LookUp('[dbo].[ras]';ras_id=Parent.Default;naam)

    The value property is naam, the name of the breed (did not set this myself i think, went automatic)

    Label 3 is an invisible label I use to temporarily store the diersoort_id from the animal table

    The default value for the datacard is just: ThisItem.ras_id

     

    I have 4 dropdowns on the edit form

    -breed (ras) see above

    -species (diersoort)

    -color (kleur)

    -furtype (vachttype)

    In the last 3 the dropdown is not filtered, they just use a master table.

    They do use sorting for example the items property of the species (diersoort) dropdown
    SortByColumns('[dbo].[diersoort]';"naam";Ascending)

     

    Like I said: all function perfectly if you give them time.

    If I would use a timer to solve this would it not just make the error less probable in stead of impossible?

    Like: If the connection is bad my rabbit gets turned into a dog?

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @HansHeintz ,

    I suggest you try this:

    turn this on: File->App settings643_LI.jpg

     

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard