Ich befülle eine Tabelle mit Daten aus einem externen Programm via Ninox-API. Dabei ist auch immer eine Textdatei als Attachment. Nun möchte ich diese Textdatei auslesen und in ein Textfeld schreiben. Grundsätzlich habe ich dafür - dank des Forums - auch schon ein Skript. Ich möchte das Skript nun immer dann starten, wenn ein neuer Datensatz mit Attachment erstellt wurde und da stehe ich jetzt an.
Ich habe in der Tabelle sowohl die Option "Trigger bei neuem Datensatz" als auch "Trigger nach Änderung" versucht, aber beide funktionieren nicht.
Hat jemand eine Idee dazu?
2Antworten
RoSoft_Steven_Rooryck
vor 4 Wochen
Gemeldet - anzeigen
You need a yes/no field and change this with your API call. The code for your txt file must be in the yes/no field trigger after update.
Michael_Leissner
vor 4 Wochen
Gemeldet - anzeigen
Danke für deine Antwort, aber ich befürchte ich scheitere hier noch mit meinem Wissen in Ninox. Wenn ich mittels API einen Datensatz erstelle, würde ich in dem Moment auch den Ja/Nein-Eintrag erstellen. Das wäre grundsätzlich noch kein Problem, aber das ist dann noch kein Wechsel, der den Trigger ausführt. Wann sollte ich dann wie den ja/nein-Eintrag ändern?
Beispielsweise (das ist auch meine Anwendung) hole ich über ein externes Programm Mails aus Exchange nach Ninox und zusätzlich das gesamte Mail als Anhang (EML-Format). Ich habe nun zB die Felder Sender, Empfänger und Betreff, sowie das Attachment. Weiters habe ich natürlich noch das Textfeld, in welches der Inhalt der EML-Datei geschrieben werden soll. Ich habe nun ein ja/nein-Feld dazugegeben und den Standardwert auf nein gesetzt. Beim Ausführen des API-Calls vom externen Programm wird bei einem neuen Datensatz das ja/nein-Feld angelegt und auf ja gesetzt. Trotzdem wird der Code nicht ausgeführt. Ändere ich nachher manuell den Status des ja/nein-Feldes im jeweiligen Datensatz, funktioniert der Trigger und der Text der EML-Datei wird in das Textfeld geschrieben.
Mache ich hier etwas falsch?
In english:
Thanks for your answer, but I'm afraid I'm still failing here with my knowledge of Ninox. If I create a data record using the API, I would also create the yes/no entry at that moment. That wouldn't be a problem in principle, but that isn't a change that executes the trigger. When and how should I change the yes/no entry?
For example (this is also my application), I use an external program to get emails from Exchange into Ninox and also the entire email as an attachment (EML format). I now have the fields sender, recipient and subject, as well as the attachment. I also have the text field in which the contents of the EML file should be written. I have now added a yes/no field and set the default value to no. When the API call is executed by the external program, the yes/no field is created for a new data record and set to yes. Despite this, the code is not executed. If I later manually change the status of the yes/no field in the respective data record, the trigger works and the text of the EML file is written into the text field.