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

Text for Lookup without result

I don't know how i can show a text if a Lookup is without a result.

 

  1. The function Barcode is started with onvisble
    If(var_Mode="QR";Set(Scan;ScanBarcode());"")
  2. The data is shown in a form. The code for item:
    LookUp('[dbo].[Kunden]';QrCode=Scan)

Everything works fine. But maybe someone would like to cheat with a wrong QR Code. How can i can check of a empty result in the form. Goal is to show a message that the "QR" is not found and make two buttons invisible. I can't work out :-(

 

Thanks for your help

Oliver

 

5 REPLIES 5
langhauserit
Level: Powered On

Re: Text for Lookup without result

I found a new approach:

If(IsBlank(LookUp('[dbo].[Kunden]';QrCode=Scan;QrCode));"Empty";"OK")

For testing reason just with a text result "empty" or "ok". 

KroonOfficeSol
Level 10

Re: Text for Lookup without result

@langhauserit

 

First set your language to englisch, this will help you in the long run finding the right answers.

 

For 1 you can lose the false condition, it not needed like in Excel. So it becomes like this:

If(var_Mode="QR";Set(Scan;ScanBarcode()))

Then I think it would be smart to store your found record in a collection (or variable), so you can set your button on the collection beïng not empty. Like this:

ClearCollect(_MyRecord, LookUp('[dbo].[Kunden]';QrCode=Scan;QrCode))

Then on the button.visible:

!IsEmtpy(_MyRecord)

An other advantage on doïng it like this is that you minimize the calls to your datasource on every control you put in the lookup.

 

Hope this helps.

 

Paul

langhauserit
Level: Powered On

Re: Text for Lookup without result

Good Morning Paul,

 

is there a way to switch just PowerApps to english? I'd do of course. But there a reasosons why i can't switch my complete Office 365 account to english. 

 

There was a problem with the ScanBarcode function so i start the function on the button one screen before. Now without false condition:

Set(QRScan;ScanBarcode());;
NewForm(WalNeu_Form);;Navigate(WalletNeu;ScreenTransition.Fade;{var_Mode:"QR"; var_QRCode: QRScan})

Affirm. I already changed to a Collection. OnStart:

If(IsBlank(LookUp('[dbo].[Kunden]';QrCode=var_QRCode;QrCode));UpdateContext({var_QRCheck: true});ClearCollect(tKunde;LookUp('[dbo].[Kunden]';QrCode=var_QRCode));;UpdateContext({var_QRCheck: false}));;

On the form visible (and some other) i check if the QRCode is available and if the customer is banned:

If(var_QRCheck=true;false;var_Sperre=true;false;true)

Thanks Paul!

 

 

Highlighted
KroonOfficeSol
Level 10

Re: Text for Lookup without result

@langhauserit

 

When you use chrome you can download an extention called 'Quick Language Switcher' This should do the trick.

 

You also can kudo this threat https://powerusers.microsoft.com/t5/PowerApps-Ideas/select-language-in-PowerApps-UWP-App/idi-p/14560

KroonOfficeSol
Level 10

Re: Text for Lookup without result

@langhauserit

 

To make your code cleaner and easier to read.

 


There was a problem with the ScanBarcode function so i start the function on the button one screen before. Now without false condition:

Set(QRScan;ScanBarcode());;
NewForm(WalNeu_Form);;Navigate(WalletNeu;ScreenTransition.Fade;{var_Mode:"QR"; var_QRCode: QRScan})

 


Do somthing like this:

Set(QRScan;ScanBarcode());;
ClearCollect(tKunde;LookUp('[dbo].[Kunden]';QrCode=QRScan));;
If(CountRows(tKunde) = 1,
	NewForm(WalNeu_Form);;
	Navigate(WalletNeu;ScreenTransition.Fade;{var_Mode:"QR"}
	;Notify("There is no kunde for the barcode, please try again";NotificationType.Warning) 
)

You now only go to the next screen when there is a record. An idea is to instead off the notification go to another screen where the user can pick/search a kunde in a list for the occassion a barcode doesn't work.

 

I think you can skip all the other formula's, because on one side you only go to the screen when there is a record and on the other side a form is only visible when there is a matching record (on view and edit) or when you set it to a newform.

 

Succes,

 

Paul

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 139 members 4,613 guests
Please welcome our newest community members: