--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/5d87e9fc-0c19-444c-8d89-2ad9fefedb29n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/51cbfbbb-bba7-42ad-853b-1e468ca09d83n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/53ce4517-0034-4b4f-935e-a8e7b6646b71n%40googlegroups.com.
Thank you in advance
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/51cbfbbb-bba7-42ad-853b-1e468ca09d83n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/e5e07f01-37ff-4d92-a049-0d1ad3216291n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/A52964CB-2194-429F-A0D6-494530EEFC87%40gmail.com.
// & country from address portion of a Memento
// Location field.
// Assumes US-en as a locale, so minor adjustment
// is required for other locales.
// Location field definition puts the full address
// (string) in the fullAddress field
var e = entry();
// Get address into a string variable to work with
var s = e.field("fullAddress");
// Get array of address components separated by commas
// (standard method of the JavaScript String object)
var splitAddress = s.split(", "); // Make array
e.set("streetAddress", splitAddress[0]);
e.set("city", splitAddress[1]); // New York
// State & zip code are separated only by a space
var stateAndZip = splitAddress[2]; // NY 10033
var sz = stateAndZip.split(" "); // Make array
e.set("state", sz[0]); // NY
e.set("zipCode", sz[1]); // 10033
e.set("country", splitAddress[3]); // USA
Minor adjustments would get this working for your locale. This solution Is specific to the US-en locale. JavaScript has an Intl object that includes locale information, and someone who learns that could alter this script to work for any locale. That would be great, and I hope someone does. The information link for this is...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl
See the attached screenshot of the resulting page from my library.
__________
Die Adresse eines Parks in meiner Nähe, wie von Memento in mein Feld fullAddress geschrieben, lautet 521 Fort Washington Ave, New York, NY 10033, USA. Angesichts dieser Zeichenfolge teilt das folgende Triggerskript diese Informationen in streetAddress, city, state, zipCode und country auf. Das Hauptwerkzeug, das ich dafür verwende, ist die JavaScript-String-Methode split(delimiterString), wobei der Wert von delimiterString in einem Fall ein Komma ("," oder vielleicht ",") und in einem anderen Fall ein Leerzeichen (" ") ist. Hier ist das Skript. Der Auslöser ist Erstellen nach dem Speichern und Aktualisieren nach dem Speichern ...
// Extrahiert Straße, Stadt, Bundesland, Postleitzahl,
// & Land aus dem Adressteil eines Andenkens
// Standortfeld.
// Setzt US-en als Gebietsschema voraus, also geringfügige Anpassung
// ist für andere Gebietsschemata erforderlich.
// Standortfelddefinition setzt die vollständige Adresse
// (String) im Feld fullAddress
<skript>
Kleinere Anpassungen würden dies für Ihr Gebietsschema zum Laufen bringen. Diese Lösung ist spezifisch für das US-en-Gebietsschema. JavaScript hat ein Intl-Objekt, das Gebietsschemainformationen enthält, und jemand, der davon erfährt, könnte dieses Skript so ändern, dass es für jedes Gebietsschema funktioniert. Das wäre großartig, und ich hoffe, jemand tut es. Der Informationslink dazu ist...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl
Siehe den beigefügten Screenshot der resultierenden Seite aus meiner Bibliothek.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/3cbff8d5-dcd2-4555-b15c-4cf3812375c3n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "mementodatabase" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mementodatabase/hFnuFHCCx68/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/CAORXpsTADS0W4rYUqCiEc_NeDVBbC%2B6gECHpk%2BVG3sE6NDKyGA%40mail.gmail.com.