cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Problem BarcodeScanner with the DatacardValue

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

2 ACCEPTED SOLUTIONS

Accepted Solutions

@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.

 

View solution in original post

@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.

View solution in original post

6 REPLIES 6
Super User III
Super User III

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.

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

@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.

 

View solution in original post

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

@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.

View solution in original post

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

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (25,556)