Powerapps patch issues when setting a field by a text label input

20 Views Asked by At

Im currently having an issue with my Set(scannedUsername,UserBarcodeCI)in Powerapps with the code below whenever I run the code the patch will update and insert fine into my SQL database table providing the scannedusername is set to a "text" rather than coming from whatever was put in the barcode slot,

This is the code

`Set(clockintime,Now()); Set(ScannedUsername,UserBarcodeCI); Set(nextPrimaryKey,Max(Filter(Clock_In_out, pkey > 0), pkey) + 1);

Patch( Clock_In_out, Defaults(Clock_In_out), { pkey:nextPrimaryKey, username:type(ScannedUsername), Clock_In_Time:clockintime //Clock out not set yet });

Notify("Data Has Been Sent Successfully",NotificationType.Success); Reset(UserBarcodeCI)`

I have tried;

  • changing the Set(ScannedUsername,UserBarcodeCI) to be Set(ScannedUsername,"Text") - This worked
  • I have removed the username:(ScannedUsername) - This worked
  • I have checked the data Type for the UserBarcodeCI and its set to Format Text
  • I have tried wrapping the UserBarcodeCI around a Text() - This didnt work
  • I have tried a concatenate around the text - This didnt work
  • The field in the database is currently set to a Varchar(50), when changing to Text - This didnt work
0

There are 0 best solutions below