HI @Anonymous
We can Patch SQL in Multiple Ways. The below code Creates or Update the record
With(
{
item: LookUp(
[@StudentTest],
StudentID = Value(DataCardValue12.Text)
)
},
If(
IsBlank(item),
Patch(
[@StudentTest],
{UserName: DataCardValue11.Text}
),
Patch(
[@StudentTest],
LookUp(
[@StudentTest],
StudentID = BrowseGallery1.Selected.StudentID
),
{UserName: DataCardValue11.Text}
)
)
)
Another approach to Update SQL, just passing ID without Lookup. In this Case StudentId is Primary Key
Patch(
[@StudentTest],
{
StudentID: BrowseGallery1.Selected.StudentID,
UserName: DataCardValue11.Text
}
)
Another Approach using Lookup (Not passing Primary key)
Patch(
[@StudentTest],
LookUp(
[@StudentTest],
StudentID = BrowseGallery1.Selected.StudentID
),
{UserName: DataCardValue11.Text}
)
- Please share with me
- how you are loading to SQL
- The data type for the Primary column and other columns that trying to create or update
Thanks,
Stalin - Learn To Illuminate