web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / power apps link to sql...
Power Apps
Unanswered

power apps link to sql using the patch function

(0) ShareShare
ReportReport
Posted on by 9

Hi All,

 

I have a barcode scanner in my app which picks up data. I want to send the barcode to the SQL database which I have in Microsoft Azure and who sent it.

 

I currently have this formula on the OnSelect button as I am using the multi scanner but when I try it on my app it says I have  ClientRequestID failure. I have the SQL table (Data_Information) as my connection in power apps so I am stumped. I know the connection works as I have another table linked to log in details. 

 

ForAll(MultiScan, Patch(Data_Information,Defaults(Data_Information),{Username:UserName1,BarCode:BarcodeScanner2}))

 

I have set the firewall to my IP address and can not figure out how to fix this issue.

 

Any help greatly appreciated. 

Categories:
I have the same question (0)
  • fletch6 Profile Picture
    9 on at

    Just to note in my SQl table I have a column names Username and another named BarCode. I also have a primary key set as ID which I dont think I need to add in to the formula as this is automatically updated when data is entered (but i could be wrong). You have to have a primary key set else Power Apps will tell you you need one. Not sure if this makes any difference as an extra query to the top. 

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @fletch6 ,

     

    Is the BarCode column required?

     

    The point is what is MultiScan table? Is it a collection which created OnScan of the Barcode scanner?

     

    I assume it is a collection something like:

    Collect(MultiScan, BarcodeScanner2.Value)

    then you will have a table that contains several barcodes you scanned in the Value column of the collection. So, OnSelect of the button should be:

    ForAll(MultiScan As MS, Patch(Data_Information,Defaults(Data_Information),{Username:UserName1,BarCode: MS.Value}));
    Clear(MultiScan);


    Base on the amount of the scanned barcodes, this would save the same amount of new records into the Data_Information table.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard