Sunday, November 17, 2019

QR/Barcode Scanning Mobile App using PowerApps integrate with Business Central & Dynamics NAV

Hello Friends,

As Mobile App development becomes very easy using PowerApps,

I have Created an App that will scan the Barcodes and QR Codes from Mobile App and Stores the scanned data into Business Central/Dynamics NAV

You can also develop this within minutes.

Just go through following steps.

Go to https://make.powerapps.com and login with your Microsoft account.

Create one Blank Canvas App.


























On the screen, just insert Barcode Scanner Control as follows.















Now insert the Gallery control to display the Scanned Data.















Now write a piece of code on “onScan” trigger of Scanner to collect the Scanned data into PowerApps Collection. “Collect(ScannedData,BarcodeScanner1.Value)”















Now Set the “Data source” Property of Gallery Control with “ScannedData”














Now Create one Microsoft flow to store these data into Business Central or any other data sources.
Go to the MS flow portal(http://flow.microsoft.com)

Create a new flow as follows.







Choose the PowerApps and set the Name as: “Insert Data” and click on create.














Meanwhile create one table(with Two fields “Entry No.”(Auto Inc.) and Scanned Value(Text[250])”) and page into Business Central to store scanned data into it; Publish the Page into Web service, as we are going to use OData URL to push Data into Business Central; and ready with OData URL along with User Name and Web Service Access Key; we’ll be using this into Flow creation.

Let’s go back to the MS Flow.


Click on New Step to and search for the “Initialize Variable” action.























Rename the Action name as “JsonFromPowerApps”; put the same name into Name Field; Type = String and Value = “Ask in PowesApps”.





















Add next Step and search for “Parse JSON”.













  • In Content Field select the “JsonFromPowerApps”. And put the JSON Schema as follows:
{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Value": {
                "type": "string"
            }
        },
        "required": [
            "Value"
        ]
    }
}































Add next step to call Business central OData service to insert the Data into Table.














Set the Method = POST; URI = “Your OData URL of Business Central”
Body = { “Scanned_Value”: “Value of Parse JSON” } and set the authentication as “Basic” as follows.














Save the Flow and go back to the PowerApps.

Add one Button to this screen and set the Text = “Insert Data”.















Select the button and go to the Action > Flows as follows.
















Select and Add the Flow which we have created.



















Now on the “onSelect” trigger, write the piece of code to call the flow from PowerApps as follows.
Set(JsonData,JSON(ScannedData));InsertData.Run(JsonData);Clear(ScannedData)
















Now go to File menu and Save this app as “Barcode with BC”.














Its time to Test this App now.
Download the “PowerApps” from Google Play store or from Apple Store for iOS Devices.
Login with Microsoft Account in which we have created PowerApps Mobile App.

You will see the App “Barcode with BC” that we just have created.
























Open the App and you will notify with the Camera permission, tap on Allow on this.

























Now tap on Scan Button to start Code Scanning; you can see the scanned data into Gallery


























































After scanning multiple codes tap on “Insert Data” to store these data into Business Central Table (It will call MS Flow and Inserts the Data into BC).
You can see the data comes into Business central within milliseconds.













You can also share innovative thoughts to develop another App like this.

Thank you for reading.
If you have any query than write in comment box

Keep Sharing....Keep Growing....

No comments:

Post a Comment