
Announcements
I have an Asset with latitude & Latitude and i am getting it using this formula:-
Set(relatedAsset,LookUp(Assets,ID=LookUp('Asset Faces',ID= LookUp('ticket Details',ID=If(IsBlank(varticketID),varNavigationID,varticketID)).'Asset Face ID').'Asset ID'));
then i am getting the latitude & Latitude of the current technicians from SharePoint list as follow:-
ClearCollect(colRelatedticketTechnicianLocation,Filter('Technicians Locations','ticket ID'=If(IsBlank(varticketID),varNavigationID,varticketID)));add a column to the collection:-
AddColumns(colRelatedticketTechnicianLocation,"Distance",0);then i am trying to Forall the items inside the collection and calculate the distance between the Asset and the Technician:-
ForAll(colRelatedticketTechnicianLocation As ticketLocation,
Patch(colRelatedticketTechnicianLocation,LookUp(colRelatedticketTechnicianLocation,ID=ticketLocation.ID),{Distance: BingMaps.GetRouteV2()});
Blank()
)
but currently i am facing these 2 issues:-
1) i am not sure how to pass the source and distention latitude & Latitude inside the BingMaps.GetRouteV2 method?
2) inside the final statement , i am getting that it can not find a column named Distance, although i added it using the Addcolumns, any advice?
Thanks
Hi @johnjohnPter ,
2) inside the final statement , i am getting that it can not find a column named Distance, although i added it using the Addcolumns, any advice?
The AddColumns function can not really add a new column for a table. Using the AddColumns function does not modify the data source, but returns a temporary table
1) i am not sure how to pass the source and distention latitude & Latitude inside the BingMaps.GetRouteV2 method?
Please try:
ForAll(colRelatedticketTechnicianLocation As ticketLocation,
Patch(
colRelatedticketTechnicianLocation,
LookUp(colRelatedticketTechnicianLocation,ID=ticketLocation[@ID]),
{Distance: BingMaps.GetRouteV2(ticketLocation[@Point1Lat]&","&ticketLocation[@Point1Long],ticketLocation[@Point2Lat]&","&ticketLocation[@Point2Long]).travelDistance}
)
)
Best Regards,
Bof