cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
HansHeintz
Level 8

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

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?

 

 

4 REPLIES 4
Dual Super User
Dual Super User

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

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!
Community Support Team
Community Support Team

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

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

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HansHeintz
Level 8

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

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?

Community Support Team
Community Support Team

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

Hi @HansHeintz ,

I suggest you try this:

turn this on: File->App settings643_LI.jpg

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (3,947)