Add StartLocationName and EndLocationName as ingredients on IFTTT

  • 1
  • Idea
  • Updated 3 years ago
  • Under Consideration
  • (Edited)
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members.

I guess above explains it ?
Photo of yozh

yozh

  • 500 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Tom

Tom, Former Employee

  • 41,706 Points 20k badge 2x thumb
Hi yozh. Are you referring to custom labels that you've created within the app? If so, custom labels aren't available on IFTTT as explained in this related topic.

Here's a complete list of the ingredients you can add to recipes that use the "New trip completed" trigger.
Photo of yozh

yozh

  • 500 Points 500 badge 2x thumb
NO not custom labels, I`m talking about this {{EndLocationLat}}) and this {{StartLocationLat}}) but actual locations not LAT... Like Adams ST, New York, NY or something like that instead of  (-74.6521929, 41.636887)


And yes sadly I see its not on the list, just why not ? 
(Edited)
Photo of Tom

Tom, Former Employee

  • 41,706 Points 20k badge 2x thumb
Thanks for the follow-up, yozh. It looks like you’re wanting StartLocationName and EndLocationName as ingredients. These two ingredients aren’t currently available, and in order to add them, we’ll need to rebuild our IFTTT channel from scratch.

I'll pass along the request, and I’m also going to change this post from a “Question” to an “Idea” so we can keep track of this request.
Photo of yozh

yozh

  • 500 Points 500 badge 2x thumb
Thanks, didnt realize that it would have to be built from scratch, just makes it really hard to identify where you started/ended if using IFTTT to create spreadsheets and emails etc.... Cant search by town or street name :( 
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
You can do it pretty easily by writing a custom function in your google sheet which calls the reversegeocoder method, then passing the gps coordinates to your sheet along with the function as an argument of the ifttt recipe.

Documentation Here
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
Your custom function would look something like this to get the best match for the lat/long.

Function getAddress(lat,long){

  var address = Maps.newGeocoder().reverseGeocode(lat, long);  

  return response.results[0].formatted_address;

}

Your IF recipe argumeent would look something like this...

some stuff|||some other stuff|||some more stuff|||=getAddress("{{EndLocationLat}}","{{EndLocationLon}}"|||=getAddress("{{StartLocationLat}}","{{StartLocationLon}}"

(Edited)
Photo of yozh

yozh

  • 500 Points 500 badge 2x thumb
That's great ! Thanks, what can we do about IF daily digest ?
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
What do you want to do about it?
Photo of yozh

yozh

  • 500 Points 500 badge 2x thumb
How to make it show actual address in the digest emails 
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
You would need to modify the script that finds the address to have it pass that back to IFTTT. The best way to do this would be by using the MAKER channel to send an API post. Depending on how much data you want in the Daily digest, you might need a whole other script just to get the data from each new trip and post it to the digest.

Here is the code you will need to make an API post for the IF portion of the action. You can get creative with string concatenation to shove all the data you want into the post.

function event_handler(V1,V2,V3){
  var key = ['YOURAPIKEYHERE'];
  var data = {
     'value1' : V1,
     'value2' : V2,
     'value3' : V3
                     }
  var options = {
    'method' : 'post',
    'payload' : data
    };
  
  for (var i=0;i<key.length;i++){
    var url = 'https://maker.ifttt.com/trigger/AUTOMATIC/with/key/'+key;
    var response = UrlFetchApp.fetch(url, options);    
  }
}
Photo of yozh

yozh

  • 500 Points 500 badge 2x thumb
Interesting, I have to look thru that.... 
Photo of Nathan

Nathan

  • 2,128 Points 2k badge 2x thumb
It's not too horribly difficult. When you enable the maker channel it provides fairly straight forward documentation.
Photo of yozh

yozh

  • 500 Points 500 badge 2x thumb
Yeah, I`m using make channel to execute some web requests... But not like this.... I will take a look. Thanks again. 

This conversation is no longer open for comments or replies.