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 Apps
Unanswered

Error management

(0) ShareShare
ReportReport
Posted on by 297

Hey,  I'm trying to calculate distance between two postcodes, one is fixed in the gallery (end) and the other is manually typed in the text input (start) i have a label in the gallery which calculates distance with the below formula:

 

BingMaps.GetRouteV3("Driving",start.Text,end.Text,{distanceUnit:"Mile"}).travelDistance

 

Trouble is, when the text box (start) is empty i get an error. Is there a way i can manage this error? if so, how? i'm new to power app building and i'm struggling to get over this hurdle. 

Categories:
I have the same question (0)
  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @jsmith87 

     

    EDITED: I initially put "Id" instead of "If"

    On your label, maybe do this:

     

    If(IsBlank(start.Text),"",
    BingMaps.GetRouteV3("Driving",start.Text,end.Text,{distanceUnit:"Mile"}).travelDistance
    )

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @jsmith87

    Make the visible property of the label: IsBlank(start.Text) || BingMaps.GetRouteV3("Driving",start.Text,end.Text,{distanceUnit:"Mile"}).travelDistance

  • cha_cha Profile Picture
    4,932 Moderator on at

    By the way, another way of doing it would be:

    IfError(
    BingMaps.GetRouteV3("Driving",start.Text,end.Text,{distanceUnit:"Mile"}).travelDistance
    ,""
    )
  • jsmith87 Profile Picture
    297 on at

    Hi, thanks for your help. I've tried this and the label now shows True, this is regardless on whether the text input (start) has a postcode or not

     

    jsmith87_0-1669195324938.png

     

  • jsmith87 Profile Picture
    297 on at

    Hi, really appreciate your help. I've tried this formula however when the text input (start) is empty i'm still getting the same errors

     

    jsmith87_1-1669195476623.png

     

  • jsmith87 Profile Picture
    297 on at

    sorry if there's something really simple i'm not doing, i'm new to the app world

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard