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 / Formula write back to ...
Power Apps
Answered

Formula write back to datasource?

(0) ShareShare
ReportReport
Posted on by 297

Hi all, 

 

I have a formula in a label that calculates the distance between two postcodes, is it possible to amend this formula so once it's calculated the distance it records that in a column in my table called "Custom"

 

Formula in label:

BingMaps.GetRouteV3("Driving",Dropdown4_1.Selected.Region,end1.Text,{distanceUnit:"Mile"}).travelDistance

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @jsmith87

    Patch(datasource, Defaults(datasource), {Custom: BingMaps.GetRouteV3("Driving",Dropdown4_1.Selected.Region,end1.Text,{distanceUnit:"Mile"}).travel Distance}) 

  • jsmith87 Profile Picture
    297 on at

    Hey, I've changed dropdown4_1 to start and end1 to end just to make it easier, unfortunately i got this error: 

     

    jsmith87_0-1669576351195.png

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @jsmith87

    Put it in a button's OnSelect property. 

  • jsmith87 Profile Picture
    297 on at

    sorry, i'm super new to this. So when i tried adding the bing code to a button before it took ages to bring up results. i have put in a button and given it this formula:

    jsmith87_0-1669580792931.png

     

    Custom is the column i want the result to go into. However i'm still getting an error on the button. Calc is the label i want to store in my table. The error on the button is unexpected curly close when expecting parenclose

     

     

    jsmith87_1-1669580966321.png

    i'm using a static excel as it allows more than 2000 rows (my table has 2500 rows) 

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @jsmith87

    Put a ")" between Text and "}" 

  • jsmith87 Profile Picture
    297 on at

    Thanks! That's resolved that issue but because it's a static excel it wont let me write back, I'll change it to a table in onedrive and just use the first 2000 lines. 

     

    Bit cheeky, but could you help with my next and hopefully final issue......

    So Calc is the label with the bing formula which works out the distances between two postcodes, i want this distance to be patched back to my data source in the column "Custom"  i can then sort my gallery based on the column "Custom" to show contractors in ascending order.  

     

    Any idea how i'd do that gallery control? currently it's 

    Filter(Table9, Trade = Dropdown3.Selected.Trade) 

     

    Dropdown three is the contractor trades

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @jsmith87

    Sort(Filter(Table9, Trade = Dropdown3.Selected.Trade), Custom, Ascending) 

  • jsmith87 Profile Picture
    297 on at

    Brilliant, thank you!

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @jsmith87

    I suggest that you move your data to SharePoint. You will have much more flexibility. 

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard