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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Problem BarcodeScanner...
Power Apps
Answered

Problem BarcodeScanner with the DatacardValue

(0) ShareShare
ReportReport
Posted on by 103

Hello,

I have problems with the BarcodeScanner. When I try to submit my form and want to view or modify it, the DataCardValue field displays its initial record + the new one (by default a barcode has 10 digits).


image.png

And when I try to create a new request just after, the field keeps the old scan even with a ResetForm(Form2)
image.png

 

On the OnScan of my BarcodeScanner i put this :

 

Set(Barcodevar;BarcodeScanner2.Value)

 

And this function in the Default field of DataCardValue :

If(
 Form2.Mode = FormMode.Edit && Form2.Mode = FormMode.View;
 "";
 Parent.Default
) & If(
 Form2.Mode = FormMode.New;
 "";
 Barcodevar
)

Can you please help me

 

Best Regards,

Imade

Categories:
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Imade ,

    Your first logic cannot ever be true - I think this is what you are trying to do

    If(
     Form2.Mode = FormMode.Edit || Form2.Mode = FormMode.View;
     Parent.Default;
     Barcodevar
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Imade Profile Picture
    103 on at

    Hi @WarrenBelz,
    Thank you for the answer.
    Now when i try to scan with the button, no information appears in the field N°Delevry.

     

    I would like that when I press the button the BarcodeScanner  fills in the Delevry field and also leaves the possibility to fill in manually if the BarCode is unreadable.

    And when i try to view or edit it show me the recorded value

  • Verified answer
    WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @Imade ,

    That is what I thought it should do - you can go the other way around on the Default of the Text Box

    If(
     Form2.Mode = FormMode.New;
     Barcodevar;
     Parent.Default
    )

    but you can also put on the OnScan on the scanner

    Set(Barcodevar;BarcodeScanner2.Value);
    Reset(YourTextBoxName)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Imade Profile Picture
    103 on at

    It works for the view and edit mode thank you !

    I still have the problem FormMode.New it still keep the record . Even with this.

    Set(Barcodevar;BarcodeScanner2.Value);;Reset(DataCardValue32)

     i tried to put it in the button new form and same thing

  • Verified answer
    WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @Imade ,

    There is something wrong here that is not obvious at the moment.

    Firstly, put a label on the screen (you can delete it later) with Barcodevar and see if you get the value in it when you scan. This proves the value is in the Variable when you need it.
    Next, clear the Variable on the saving the form - if you are using SubmitForm(), put this on the OnSuccess of the form

    Set(Barcodevar,Blank())

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Imade Profile Picture
    103 on at

    @WarrenBelz ,
    It works with the submit!
    Once again you've helped me a lotthank you!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard