今日发现应用无法使用,获取BarcodeReader的值的命令提示错误:无法识别Value.
First(BarcodeReader2.Barcodes).Value
前几天就因为有些手机无法扫描条形码,所以修改了些设置。以为是这个原因,将设置修改回来也没有作用。
好在现在AI已经发达了,直接问,果然找到答案。Power Apps的版本问题,看来又是微软搞幺蛾子。
将Power Apps更改为较旧的版本
参考:电源应用程序 - 无法定义变量以获取条形码读取器的价值 - Microsoft社区
另:
如果无法回退版本,可使用以下替代方法获取扫描结果:(没试过)
方法 1:使用 BarcodeReader.Barcodes
集合
powerapps
ClearCollect(ScannedBarcodes, BarcodeReader2.Barcodes); Set(ScannedValue, First(ScannedBarcodes).Value)
方法 2:直接访问 BarcodeReader
属性
powerapps
Set(ScannedValue, BarcodeReader2.Value)