cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
NewBee117
Level: Powered On

In a gallery, patch current row to SQL table on de-selecting / leaving

I want to save the row data to Azure database when another row is selected or when the focus leaves that row. The next selected row could be any row, not in sequence. Is it possible? 

 

Original problem: I added text, drop down and date input control in a gallery. Currently patch for OnChange works well updating the database, however, it takes 10 to 15 sec per patch, and after that, tab index gets a random assignment. So users have to wait that long to change each cell, and after that, they need to use the mouse to put the cursor back to where it should be. So I want to batch update only once, when leaving that row.

 

Appreciate any suggestion. Thanks.   

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: In a gallery, patch current row to SQL table on de-selecting / leaving

Hi @NewBee117 ,

If you want to patch every time you leave the row, you need one action to represent this action "leave one row".

Please note that you firstly need to edit data in row1, so I not suggest you use the textinput , drop down, date picker's OnSelect or OnChange. Or else it will not only patch when you change row, but also will patch when you edit data in row1.

I suggest you click the arrow button firstly when you change row.

Then every time you want to change row to edit, you need to click next row's arrow button. This action could be used to represent this action "change row".

I've made a similar test for your reference:

set the arrow button's OnSelect:

 

If(!IsBlank(var),Patch(table,LookUp(table,ID=var.ID),{.....}));Set(var,ThisItem)

 

12231.PNG

 

In this way, when you click another row's arrow button, your latest row will be patched.

What's more, the data in the latest row may can not be used directly when you click another row's arrow button.

You could set the Textinput's OnChange:

 

 Set(vartext,Textinput1.Text)

 

set the dropdown's OnChange: 

 

Set(vardrop,drop down1.Selected.Value)

 

set the datepicker's OnChange:

 

 Set(vardate,datepicker1.SelectedDate)

 

Then use these data to patch:

 

If(!IsBlank(var),Patch(table,LookUp(table,ID=var.ID),{field1:vartext,field2:vardrop,field3:vardate,....}));Set(var,ThisItem)

 

 

If you do not want to use "click arrow button" represent the leave action, you could also use "click the new row's blank space"to represent the leave action.

In this situation, you just need to set the gallery's OnSelect:

If(!IsBlank(var),Patch(table,LookUp(table,ID=var.ID),{field1:vartext,field2:vardrop,field3:vardate,....}));Set(var,ThisItem)

 

Best regards,

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.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: In a gallery, patch current row to SQL table on de-selecting / leaving

Hi @NewBee117 ,

If you want to patch every time you leave the row, you need one action to represent this action "leave one row".

Please note that you firstly need to edit data in row1, so I not suggest you use the textinput , drop down, date picker's OnSelect or OnChange. Or else it will not only patch when you change row, but also will patch when you edit data in row1.

I suggest you click the arrow button firstly when you change row.

Then every time you want to change row to edit, you need to click next row's arrow button. This action could be used to represent this action "change row".

I've made a similar test for your reference:

set the arrow button's OnSelect:

 

If(!IsBlank(var),Patch(table,LookUp(table,ID=var.ID),{.....}));Set(var,ThisItem)

 

12231.PNG

 

In this way, when you click another row's arrow button, your latest row will be patched.

What's more, the data in the latest row may can not be used directly when you click another row's arrow button.

You could set the Textinput's OnChange:

 

 Set(vartext,Textinput1.Text)

 

set the dropdown's OnChange: 

 

Set(vardrop,drop down1.Selected.Value)

 

set the datepicker's OnChange:

 

 Set(vardate,datepicker1.SelectedDate)

 

Then use these data to patch:

 

If(!IsBlank(var),Patch(table,LookUp(table,ID=var.ID),{field1:vartext,field2:vardrop,field3:vardate,....}));Set(var,ThisItem)

 

 

If you do not want to use "click arrow button" represent the leave action, you could also use "click the new row's blank space"to represent the leave action.

In this situation, you just need to set the gallery's OnSelect:

If(!IsBlank(var),Patch(table,LookUp(table,ID=var.ID),{field1:vartext,field2:vardrop,field3:vardate,....}));Set(var,ThisItem)

 

Best regards,

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.

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,478)