cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamGill
Resolver II
Resolver II

Correct Syntax for UPDATE Command to an SQL Data Table from within a Gallery?

I am attempting a very simple UPDATE to a row/column item in an SQL Data Table. The SQL Data Table contains a Primary Key (ID) and I have full read/write access via the Data Connector I have set up. Here is the syntax I am attempting to use through an Icon image OnSelect - I feel sure that something is "not quite right":

 

Update(SQLTABLENAME,ThisItem.ID,{Task_Notes:TaskNotesUpdate.Text})

 

Task_Notes is a VarChar(MAX) Column in my SQLTABLENAME

TaskNotesUpdate is a Text Input Field on a Gallery in my PowerApp

 

Error message states "...the formula uses scope, which is not presently supported for evaluation..."

 

Any pointers would be greatly appreciated -  thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
zmorek
Super User
Super User

Is the icon being selected in a gallery? I think you might want to try Patch() instead:

Patch(SQLTABLENAME, ThisItem, {Task_Notes:TaskNotesUpdate.Text}))

Edit: woops I was typing this response before I saw your second post; let me ask to be sure .. Is the icon in a gallery? You won't need Value() around your text field unless you're trying to convert it to a number.

View solution in original post

3 REPLIES 3
AdamGill
Resolver II
Resolver II

I have also tried this with a PATCH command - but this also fails:

 

Patch(SQLDATATABLE,ThisItem,{Task_Notes:Value(TaskNotesUpdate.Text)})

zmorek
Super User
Super User

Is the icon being selected in a gallery? I think you might want to try Patch() instead:

Patch(SQLTABLENAME, ThisItem, {Task_Notes:TaskNotesUpdate.Text}))

Edit: woops I was typing this response before I saw your second post; let me ask to be sure .. Is the icon in a gallery? You won't need Value() around your text field unless you're trying to convert it to a number.

Thank you - yes, it was the "Value" element causing this issue.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,279)