cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Stmorgan
Level: Powered On

Scan Barcode/Email

I have created the scanner and it is working great. I have it set to go to a gallery as a collection...

 

Collect(ScannerButton,{CPE: ScanBarcode()})

 

My question is how can I then take this barcode scan gallery/collection and email it? I can't figure out the coding at all...I currently have this...

 

Office365.SendEmail("test.email", "test", "test2" concat(Scannerbutton, CPE) I don't even mind sending it as an attachment is there is a way to do that...I can send pics no problem this way but I can't get scanned UPC's to attach to the email. Thanks for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
Mike8
Level 10

Re: Scan Barcode/Email

Hello Stmorgan,

You can try this:
Office365.SendEmail("emailhere@email.com","BarcodeTestSubject","These are the scanned barcodes:"&Char(13)&Concat(Scannerbutton,CPE&Char(13)&Char(13))&"Thank you")

Char(13) is used to create a new line

3 REPLIES 3
Mike8
Level 10

Re: Scan Barcode/Email

Hello Stmorgan,

You can try this:
Office365.SendEmail("emailhere@email.com","BarcodeTestSubject","These are the scanned barcodes:"&Char(13)&Concat(Scannerbutton,CPE&Char(13)&Char(13))&"Thank you")

Char(13) is used to create a new line

yukonn
Level 8

Re: Scan Barcode/Email

Hi @Stmorgan,

 

You cannot directly send gallery/collection as attachment. Because scanned the barcode is text value but eamil attachment only accept the blob. You need to convert barcode value to blob after that attach to email. I don't know exactly what is your requirement. I try to make sample base on your question.

 

Here is scenario of sample

1. Scan barcode

2. Convert String to file blob(txt file) and save it into gallary

3. Send the email

 

I need to create the flow for convert string to file before start create the App.

 

Here is flow. 

 

ConvertStringToFile.png

 

Save as "Convert StringToFile" after create the flow.

 

 

Here is App use with flow and send mail with attachment.

Add Flow to App

Flow.png

 

Reset

Reset Barcode.png

UpdateContext({varScannedResult: ""});
Clear(collScanned)

 

Scan Barcode

Scan Barcode.png

UpdateContext({varScannedResult: ScanBarcode()});
If(
    (varScannedResult <> ""),
    Collect(
        collScanned,
        {
            Name: Concatenate(
                varScannedResult,
                ".txt"
            ),
            ContentBytes: ConvertStringToFile.Run(varScannedResult).file,
            '@odata.type': "byte"
        }
    )
)

Please take note : Collection item must be save as above.

Send Mail

Scan Barcode.png

If(
    (!IsEmpty(collScanned) And (EMailAddr.Text <> "")),
    Office365.SendEmail(
        EMailAddr.Text,
        "BarCodeList",
        "Please find my attach for scanned barcode List",
        {Attachments: collScanned}
    )
)

Final.png

 

Regards,

Stmorgan
Level: Powered On

Re: Scan Barcode/Email

This worked perfect!! Thanks a ton!! I've been struggling with it for days.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 363 members 5,507 guests
Please welcome our newest community members: