cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shashi_Prudent
Frequent Visitor

refresh gallery from sql immediiate after insert

i have developed a screen in powerapps that does inserting data from collection to SQL ( using ForAll, Patch), and also delete (by using the Remove) from SQL and local collection.

 

my problem is suppose I add 4 line items locally, and then save to SQL, and immediately call the saved data to display again in the gallery, is not working in a single button (OnSelect), and adding another button to relaod the data, it is working but i need to click few times, to get the data from SQL and bind to the Gallery.

 

there are like different scenarios like 

1. adding first time locally and then save to SQL

2. retrieve data from SQL, then adding new records OR edit the SQL records and then save back to SQL

3. retrieve data from SQL, delete the saved data, then add local data, and edit / delete the local data and finally save to SQL

 

and in all this scenarios once saved to SQL, call the latest data from SQL and display in Gallery is not working consistently. All the above doing in a single screen

 

Please advise in case this can be done in different ways..thanks in advance

2 REPLIES 2
yashag2255
Dual Super User II
Dual Super User II

Hi @Shashi_Prudent 

 

Can you try to refresh the data source after performing the Patch operation on all items. THis can be done by adding this expression after the ForAll loop:
 
Expression: ForAll(...); Refresh(DataSourceName) 
Please replace the DataSourceName with the actual name of data source.
 
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!

Hi @Shashi_Prudent 

 

Were you able to resolve this? 

 

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!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (94,581)