Hi @MazingerZ_68,
Below I have provided a couple of possible options.
If you want to allow both Text and Scan search (return record if it contains either) you could use the Filter function with the in operator:
Filter(
Contratistanew;
TextSearchBox1.Text in Cedula || ScannedValue in Cedula
)
Should you want one to take precedence over the other, you could use the Coalesce function:
With(
//TextInput takes priority over scanned value
//Use Coalesce(ScannedValue; TextSearchBox1.Text) instead should the scanned value take priority
{wCondition: Coalesce(TextSearchBox1.Text; ScannedValue)};
Filter(
Contratistanew;
wCondition in Cedula
)
)
Alternatively, you could visualize the scanned code in TextSearchBox1 and only use the searchbox as filter condition.
(1) Place the scan button on the same screen as TextSearchBox1
(2) Set the BarcodeReader OnScan property to:
//Save code to a local variable used in search box default property
UpdateContext({ScannedValue:First(Self.Barcodes).Value});;
//Reset searchbox back to default value (variable)
Reset(TextSearchBox1)
(3) Set TextSearchBox1 Default property to:
ScannedValue
(4) Set the gallery items property to:
Filter(
Contratistanew;
TextSearchBox1.Text in Cedula
)
If this solves your question, would you be so kind as to accept it as a solution.
Thanks!