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 / Navigate to a screen w...
Power Apps
Answered

Navigate to a screen when form is empty

(0) ShareShare
ReportReport
Posted on by 65

Hello! Please, I need a help.

 

I´m developing a powerapp app to scan a barcode from an item to return a record.

 

On the main screen I added a button "Escanear" to read the barcode and at the OnScan property I add the following code:

 

Set(varScan; BarcodeScan.Value) ;; EditForm(EditForm1_1) ;; Navigate('Alterar Scan Patrimônio';ScreenTransition.Fade)

 

This way, the app reads the barcode and brings the record to the "Alterar Scan Patrimônio" screen correctly, once it exists.

 

The problem is when the record does not exist. When this happens, the app shows the screen "Alterar Scan Patrimônio" empty. In this situation I wanted the app to navigate to another screen. I tryed to add the command Navigate to the OnFailure form property but it does not work.

 

How can I do it?

 

Thank you in advance!

Categories:
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @BrosJr ,

     

    You could check the record before navigating:

    • If the record exists, then navigate to 'Alterar Scan Patrimônio'
    • If the record does not exist, then navigate to an other screen

     

    Set(varScan; BarcodeScan.Value) ;; 
    EditForm(EditForm1_1) ;; 
    If(
     IsBlank(LookUp(DataSource;ColumnName=varScan));
     Navigate('OtherScreen');
     Navigate('Alterar Scan Patrimônio';ScreenTransition.Fade)
    )

     

    Best Regards,

    Bof

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard