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

Collection not sending all data to SQL table

I'm trying to write data back to a SQL table. Depending what order I complete my fields on the form, determines which fields get transfered over. 

 

So, for example, if I enter the fields tabing through the form, it leaves the last two fields off the last record (so i'm left with no price or notes for the 3rd and final quote). If I dont stick to the tab order, it will leave other info off. 

 

This is my code on the submit button, any ideas as to what is causing it to cut off information? I even added another button, which then enables the submit button, thinking it may just need time but this isn't the case. 

 

ForAll(
UploadData,
Patch('[dbo].[tblFrameworkJobTenders]',Defaults('[dbo].[tblFrameworkJobTenders]'),{FrameworkJobID:Value(UploadData[@FrameworkJobID]),CompanyID:UploadData[@CompanyID],Price:Value(UploadData[@Price]),WinningBid:UploadData[@WinningBid],Notes:UploadData[@Notes]})
);
Navigate(Screen3,Fade)

 

Thank you in advance for any help.

 

Kindest regards

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Collection not sending all data to SQL table

Hi @ggeorge,

Could you please share a bit more about your scenario?

Could you please share a bit more about the UploadData that you mentioned? Is it a Collection?

How many records stored within your UploadData collection?

Do you mean that not all records within your UploadData collection are saved back to the SQL table?

Please take a try to modify your formula as below:

ForAll(
 RenameColumns(
RenameColumns(
RenameColumns(
RenameColumns(
RenameColumns(UploadData,"FrameworkJobID","FrameworkJobID1"),
"CompanyID","CompanyID1"),
"Price","Price1"),
"WinningBid","WinningBid1"),
"Notes","Notes1"
), Patch(
'[dbo].[tblFrameworkJobTenders]',
Defaults('[dbo].[tblFrameworkJobTenders]'),
{
FrameworkJobID: FrameworkJobID1,
CompanyID: CompanyID1,
Price: Price1,
WinningBid: WinningBid1,
Notes: Notes1
}
) );
Navigate(Screen3,ScreenTransition.Fade)

then check if the issue is solved.

In addition, please also take a try to turn off/disable the "Improved app rendering (final validation)" option within Advanced settings of App settings, then check if the issue is solved.

If the issue still exists, please take a try to re-create your app, then check if the issue still exists.

 

Best regards,

Kris

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

Re: Collection not sending all data to SQL table

Hi @ggeorge,

Could you please share a bit more about your scenario?

Could you please share a bit more about the UploadData that you mentioned? Is it a Collection?

How many records stored within your UploadData collection?

Do you mean that not all records within your UploadData collection are saved back to the SQL table?

Please take a try to modify your formula as below:

ForAll(
 RenameColumns(
RenameColumns(
RenameColumns(
RenameColumns(
RenameColumns(UploadData,"FrameworkJobID","FrameworkJobID1"),
"CompanyID","CompanyID1"),
"Price","Price1"),
"WinningBid","WinningBid1"),
"Notes","Notes1"
), Patch(
'[dbo].[tblFrameworkJobTenders]',
Defaults('[dbo].[tblFrameworkJobTenders]'),
{
FrameworkJobID: FrameworkJobID1,
CompanyID: CompanyID1,
Price: Price1,
WinningBid: WinningBid1,
Notes: Notes1
}
) );
Navigate(Screen3,ScreenTransition.Fade)

then check if the issue is solved.

In addition, please also take a try to turn off/disable the "Improved app rendering (final validation)" option within Advanced settings of App settings, then check if the issue is solved.

If the issue still exists, please take a try to re-create your app, then check if the issue still exists.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ggeorge
Level: Powered On

Re: Collection not sending all data to SQL table

Hi I'm getting the following error:

 

"This type of arguement 'FrameworkJobId' does not match the expected type number..."

 

Do I need to amend the code somehow to say value? Can you please advise.

 

Thanks again

 

Community Support Team
Community Support Team

Re: Collection not sending all data to SQL table

Hi @ggeorge,

The error message told that you have provided a incorrect type value for the FrameworkJobId column. Please take a try to modify your formula as below:

ForAll(
 RenameColumns(
     RenameColumns(
         RenameColumns(
             RenameColumns(
                 RenameColumns(UploadData,"FrameworkJobID","FrameworkJobID1"),
                "CompanyID","CompanyID1"),
             "Price","Price1"),
    "WinningBid","WinningBid1"),
 "Notes","Notes1"
),
 Patch(
      '[dbo].[tblFrameworkJobTenders]',
       Defaults('[dbo].[tblFrameworkJobTenders]'),
       {
         FrameworkJobID: Value(FrameworkJobID1),  /* <-- Use Value() function to convert a string value into a number value */
         CompanyID: CompanyID1,
         Price: Price1,
         WinningBid: WinningBid1,
         Notes: Notes1
       }
    )
);
Navigate(Screen3,ScreenTransition.Fade)

then check if issue is solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ggeorge
Level: Powered On

Re: Collection not sending all data to SQL table

 

We submit form 1, the data goes sucessfully to tblFrameworkJobs.

 

When we submit form 2, it puts in the correct FrameworkJobID as shown below:

 

tblFrameworkJobTenderstblFrameworkJobTenders

MiniTenderID, CompanyID, FrameworkJobID, Price, WinningBid, Notes

821948 0 
832748 0 

 

However, it doesn't carry over the Price, Winning Bid (Yes/No) or the Notes.

 

The code I just tried on the submit of button 2 was:

 

ForAll( RenameColumns( RenameColumns( RenameColumns( RenameColumns( RenameColumns(UploadData,"FrameworkJobID","FrameworkJobID1"), "CompanyID","CompanyID1"), "Price","Price1"), "WinningBid","WinningBid1"), "Notes","Notes1" ), Patch( '[dbo].[tblFrameworkJobTenders]', Defaults('[dbo].[tblFrameworkJobTenders]'), { FrameworkJobID: Value(FrameworkJobID1), CompanyID: CompanyID1, Price: Value(Price1),WinningBid: WinningBid1, Notes: Notes1 } ) ); Navigate(Screen3,ScreenTransition.Fade)

 

See attached screen shot of form we are trying to send to SQL on premise. 

 

Thanks again Smiley Happy

ggeorge
Level: Powered On

Re: Collection not sending all data to SQL table

Hi all

 

Please find attached a word document with screenshots (sql table & power app forms), code snipets to gain a better understanding of my issue.

 

In summary:

I enter a job on form 1, works fine, all data is transfered to the table. Then on screen 2, many people can be selected to quote, when entering the quote details on the second form, it misses off information on the last row.

 

See attached document. I tried turning off the app rendering, i've tried waiting before submitting etc. all to no avail.

 

Please help Smiley Happy 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 192 members 4,265 guests
Please welcome our newest community members: