cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Updating SQL record

On my first screen I choose a button (1-5), this will pass in the Part Count value depending on what button is clicked.  When I check the variables I can see that is correct.  When I click the "Update" button which is tied to the code below it doesn't update my SQL database;

 

UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,
Switch(
PartCount,
1,
{WIPCount1: (TextInput1_3.Text + DataCardValue4_1)},
2,
{WIPCount2: (TextInput1_3.Text + DataCardValue4_1)},
3,
{WIPCount3: (TextInput1_3.Text + DataCardValue4_1)},
4,
{WIPCount4: (TextInput1_3.Text + DataCardValue4_1)},
5,
{WIPCount5: (TextInput1_3.Text + DataCardValue4_1)}
)
);
UpdateContext({visible: true})

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver II
Resolver II

Re: Updating SQL record

Try switching it up with something like this:

Switch(
PartCount,
1,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount1: (TextInput1_3.Text + DataCardValue4_1)}),
2,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount2: (TextInput1_3.Text + DataCardValue4_1)}),
3,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount3: (TextInput1_3.Text + DataCardValue4_1)}),
4,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount4: (TextInput1_3.Text + DataCardValue4_1)}),
5,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount5: (TextInput1_3.Text + DataCardValue4_1)})
);
UpdateContext({visible: true})

 

------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------ 
If this post helps answer your question, please click on “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up. 

View solution in original post

2 REPLIES 2
Highlighted
Resolver II
Resolver II

Re: Updating SQL record

Try switching it up with something like this:

Switch(
PartCount,
1,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount1: (TextInput1_3.Text + DataCardValue4_1)}),
2,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount2: (TextInput1_3.Text + DataCardValue4_1)}),
3,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount3: (TextInput1_3.Text + DataCardValue4_1)}),
4,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount4: (TextInput1_3.Text + DataCardValue4_1)}),
5,
UpdateIf(
'[dbo].[TCIEYREndPrt]',
ProductNumber = BrowseGallery1_3.Selected.ProductNumber,{WIPCount5: (TextInput1_3.Text + DataCardValue4_1)})
);
UpdateContext({visible: true})

 

------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------ 
If this post helps answer your question, please click on “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up. 

View solution in original post

Highlighted
Helper I
Helper I

Re: Updating SQL record

Thank you for the help, I would have never thought of Switch like that.

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,212)