Complete beginner here:
I have an array with many collections that contain empty items. How do I flatten it so that I get one array with all the empty data filtered out?
Thank you!
Complete beginner here:
Thank you!
Welcome to the Make community!
What is your text parser trying to do? What comes before it?
Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.
You can upload images here using the Upload icon in the text editor:
Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.
(Note: Exporting your scenario will not include private information or keys to your connections)
Uploading it here will look like this:
blueprint.json (12.3 KB)
Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Save the bundle contents in your text editor as a bundle.txt
file, and upload it here into this discussion thread.
Uploading it here will look like this:
bundle.txt (12.3 KB)
If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:
Either add three backticks ```
before and after the code, like this:
```
input/output bundle content goes here
```
Or use the format code button in the editor:
Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.
Following these steps will allow others to assist you here. Thanks!
The text parser extracts data from an email using regex:
Name:\s(?[^\n]+)|Straße:\s(?[^\n]+)|Stadt:\s(?[^\n]+)|Telefon:\s(?[^\n]+)
I want to add the data to a google sheet. If I use the data from the text parser directly in the google sheets module it creates a new row for EACH bundle, whereas I want one row with all the data. Therefore I need to combine the 23 bundles into one array.
Help greatly appreciated
Can you describe how you want the data inserted into a single row? Or it doesn’t matter as long as it’s inserted in the matched/bundle order?
Can you provide the text that is going into the Text Parser? (Read above on how to share Input/Output bundles)
Can you provide a screenshot of the Text Parser fields, or the scenario blueprint if the screenshot does not show everything? (Read above on how to export blueprint)
Looks like the pattern you pasted into the forum is incorrect, and might have been modified by the forum software. In future, please format your code.
Either add three backticks ```
before and after the code, like this:
```
content goes here
```
Or use the format code button in the editor:
I’m asking all these question about the Text Parser because there might be a better way of doing it.
there’s 23 data points in the email that I need to extract, that’s why i’m using one long regex to capture everything instead of doing 23 operations
Input:
[
{
"text": "Kontaktdaten zur Anfrage\nName: Herr Konrad Müller\nStraße: Musterstr 27\nStadt: 11111 Musterstadt\nTelefon: 123456789\nE-Mail: test@hotmail.de\nAnfragenummer: 9744253 Details zur Anfrage\nStadt: Musterstadt\nFachgebiet: Test\nTätigkeit: Neuinstallation / Einbau\nBaujahr des Objekts: vor 1978\nPersonen im Haushalt: 1-2\nzu heizende Fläche (in qm): 140\nProjektbeginn: In 3 bis 6 Monaten\nKontaktaufnahme möglich ab: 26.02.2024\nErreichbarkeit unter der Woche: Ganztags\nArt des Objekts: Einfamilienhaus\nAktuell benutzte Heizung: Ölheizung\nEigentumsverhältnisse: Eigner / Entscheidungsbefugt\nVorhandene Heizkörper: Fußbodenheizung im Erdgeschoss + Heizkörper\nGewünschter Standort der Heizung: Keller\nArt der Wärmepumpe: Luft-Wasser-Wärmepumpe\nKommentar: Rippenheizkörper sind auch noch vorhanden.\n\nBei Fragen antworten Sie einfach auf diese E-Mail. Wir melden uns zeitnah\nbei Ihnen zurück.\n"
}
]
Output:
[
{
"i": 1,
"Name": "Herr Konrad Müller"
},
{
"i": 2,
"Strasse": "Muster 27"
},
{
"i": 3,
"Stadt": "12345 Muster"
},
{
"i": 4,
"Telefon": "12345678"
},
{
"i": 5,
"Email": "muster@hotmail.de"
},
{
"i": 6,
"Anfragenummer": "9744253"
},
{
"i": 7,
"Stadt": "muster"
},
{
"i": 8,
"Fachgebiet": "Wärmepumpe"
},
{
"i": 9,
"Taetigkeit": "Neuinstallation / Einbau"
},
{
"i": 10,
"BaujahrDesObjekts": "vor 1978"
},
{
"i": 11,
"PersonenImHaushalt": "1-2"
},
{
"i": 12,
"ZuHeizendeFlaeche": "140"
},
{
"i": 13,
"Projektbeginn": "In 3 bis 6 Monaten"
},
{
"i": 14,
"KontaktaufnahmeMoeglichAb": "26.02.2024"
},
{
"i": 15,
"Erreichbarkeit": "Ganztags"
},
{
"i": 16,
"ArtDesObjekts": "Einfamilienhaus"
},
{
"i": 17,
"AktuellBenutzteHeizung": "Ölheizung"
},
{
"i": 18,
"Eigentumsverhaeltnisse": "Eigner / Entscheidungsbefugt"
},
{
"i": 19,
"VorhandeneHeizkoerper": "Fußbodenheizung im Erdgeschoss + Heizkörper"
},
{
"i": 20,
"GewuenschterStandortDerHeizung": "Keller"
},
{
"i": 21,
"ArtDerWaermepumpe": "Luft-Wasser-Wärmepumpe"
},
{
"i": 22,
"Kommentar": "Rippenheizkörper sind auch noch vorhanden."
}
]
Regex:
Name:\s(?<Name>[^\n]+)|Straße:\s(?<Strasse>[^\n]+)|Stadt:\s(?<Stadt>[^\n]+)|Telefon:\s(?<Telefon>[^\n]+)|E-Mail:\s(?<Email>[^\n]+)|Anfragenummer:\s(?<Anfragenummer>[^\n]+)(?=\sDetails\s+zur\s+Anfrage)|Fachgebiet:\s(?<Fachgebiet>[^\n]+)|Tätigkeit:\s(?<Taetigkeit>[^\n]+)|Baujahr des Objekts:\s(?<BaujahrDesObjekts>[^\n]+)|Personen im Haushalt:\s(?<PersonenImHaushalt>[^\n]+)|zu heizende Fläche \(in qm\):\s(?<ZuHeizendeFlaeche>[^\n]+)|Projektbeginn:\s(?<Projektbeginn>[^\n]+)|Kontaktaufnahme möglich ab:\s(?<KontaktaufnahmeMoeglichAb>[^\n]+)|Erreichbarkeit unter der Woche:\s(?<Erreichbarkeit>[^\n]+)|Art des Objekts:\s(?<ArtDesObjekts>[^\n]+)|Aktuell benutzte Heizung:\s(?<AktuellBenutzteHeizung>[^\n]+)|Eigentumsverhältnisse:\s(?<Eigentumsverhaeltnisse>[^\n]+)|Mehrere Heizungskomponenten\?:\s(?<MehrereHeizungskomponenten>[^\n]+)|Vorhandene Heizkörper:\s(?<VorhandeneHeizkoerper>[^\n]+)|Gewünschter Standort der Heizung:\s(?<GewuenschterStandortDerHeizung>[^\n]+)|Art der Wärmepumpe:\s(?<ArtDerWaermepumpe>[^\n]+)|Kommentar:\s(?<Kommentar>.+)
Blueprint:
blueprint.json (62.9 KB)
Thank you!!!
ok let me rephrase:
How do I get many collections with different variables into one collection
The array aggregator seems not to be the correct place as it outputs one array with many collections where the data is not combined properly
Welcome to the Make community!
You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):
Name: (?<Name>.+)\nStraße: (?<Strasse>.+)\nStadt: (?<Stadt>.+)\nTelefon: (?<Telefon>.+)\nE-Mail: (?<Email>.+)\nAnfragenummer: (?<Anfragenummer>.+)\nStadt: (?<Stadt2>.+)\nFachgebiet: (?<Fachgebiet>.+)\nTätigkeit: (?<Taetigkeit>.+)\nBaujahr des Objekts: (?<BaujahrDesObjekts>.+)\nPersonen im Haushalt: (?<PersonenImHaushalt>.+)\nzu heizende Fläche \(in qm\): (?<ZuHeizendeFlaeche>.+)\nProjektbeginn: (?<Projektbeginn>.+)\nKontaktaufnahme möglich ab: (?<KontaktaufnahmeMoeglichAb>.+)\nErreichbarkeit unter der Woche: (?<Erreichbarkeit>.+)\nArt des Objekts: (?<ArtDesObjekts>.+)\nAktuell benutzte Heizung: (?<AktuellBenutzteHeizung>.+)\nEigentumsverhältnisse: (?<Eigentumsverhaeltnisse>.+)\nVorhandene Heizkörper: (?<nVorhandene>.+)\nGewünschter Standort der Heizung: (?<GewuenschterStandortDerHeizung>.+)\nArt der Wärmepumpe: (?<ArtDerWaermepumpe>.+)\nKommentar: (?<Kommentar>.+)
For more information, see Text Parser in the Make Help Center:
Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.
- The complete list of metacharacters can be found on the MDN web docs website.
- For a tutorial on how to create regular expressions, we recommend the RegexOne website.
- For an easy, quick regex generator, try the Regular Expressions generator.
- For experimenting with regular expressions, we recommend the regular expressions 101 website. Just make sure to tick the ECMAScript (JavaScript) FLAVOR in the left panel.
Hope this helps!
You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.
Copy the code below by clicking the copy button when you mouseover the top-right of the code block
Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV to paste in the canvas.
Click on each imported module and save it. You may need to remap some variables.
{
"subflows": [
{
"flow": [
{
"id": 85,
"module": "regexp:Parser",
"version": 1,
"parameters": {
"pattern": "Name: (?<Name>.+)\\nStraße: (?<Strasse>.+)\\nStadt: (?<Stadt>.+)\\nTelefon: (?<Telefon>.+)\\nE-Mail: (?<Email>.+)\\nAnfragenummer: (?<Anfragenummer>.+)\\nStadt: (?<Stadt2>.+)\\nFachgebiet: (?<Fachgebiet>.+)\\nTätigkeit: (?<Taetigkeit>.+)\\nBaujahr des Objekts: (?<BaujahrDesObjekts>.+)\\nPersonen im Haushalt: (?<PersonenImHaushalt>.+)\\nzu heizende Fläche \\(in qm\\): (?<ZuHeizendeFlaeche>.+)\\nProjektbeginn: (?<Projektbeginn>.+)\\nKontaktaufnahme möglich ab: (?<KontaktaufnahmeMoeglichAb>.+)\\nErreichbarkeit unter der Woche: (?<Erreichbarkeit>.+)\\nArt des Objekts: (?<ArtDesObjekts>.+)\\nAktuell benutzte Heizung: (?<AktuellBenutzteHeizung>.+)\\nEigentumsverhältnisse: (?<Eigentumsverhaeltnisse>.+)\\nVorhandene Heizkörper: (?<nVorhandene>.+)\\nGewünschter Standort der Heizung: (?<GewuenschterStandortDerHeizung>.+)\\nArt der Wärmepumpe: (?<ArtDerWaermepumpe>.+)\\nKommentar: (?<Kommentar>.+)",
"global": false,
"sensitive": true,
"multiline": false,
"singleline": false,
"continueWhenNoRes": false
},
"mapper": {
"text": "{{84.text}}"
},
"metadata": {
"designer": {
"x": 1465,
"y": 1014,
"messages": [
{
"category": "last",
"severity": "warning",
"message": "A transformer should not be the last module in the route."
}
]
},
"restore": {},
"parameters": [
{
"name": "pattern",
"type": "text",
"label": "Pattern",
"required": true
},
{
"name": "global",
"type": "boolean",
"label": "Global match",
"required": true
},
{
"name": "sensitive",
"type": "boolean",
"label": "Case sensitive",
"required": true
},
{
"name": "multiline",
"type": "boolean",
"label": "Multiline",
"required": true
},
{
"name": "singleline",
"type": "boolean",
"label": "Singleline",
"required": true
},
{
"name": "continueWhenNoRes",
"type": "boolean",
"label": "Continue the execution of the route even if the module finds no matches",
"required": true
}
],
"expect": [
{
"name": "text",
"type": "text",
"label": "Text"
}
],
"interface": [
{
"type": "text",
"name": "Name",
"label": "Name"
},
{
"type": "text",
"name": "Strasse",
"label": "Strasse"
},
{
"type": "text",
"name": "Stadt",
"label": "Stadt"
},
{
"type": "text",
"name": "Telefon",
"label": "Telefon"
},
{
"type": "text",
"name": "Email",
"label": "Email"
},
{
"type": "text",
"name": "Anfragenummer",
"label": "Anfragenummer"
},
{
"type": "text",
"name": "Stadt2",
"label": "Stadt2"
},
{
"type": "text",
"name": "Fachgebiet",
"label": "Fachgebiet"
},
{
"type": "text",
"name": "Taetigkeit",
"label": "Taetigkeit"
},
{
"type": "text",
"name": "BaujahrDesObjekts",
"label": "BaujahrDesObjekts"
},
{
"type": "text",
"name": "PersonenImHaushalt",
"label": "PersonenImHaushalt"
},
{
"type": "text",
"name": "ZuHeizendeFlaeche",
"label": "ZuHeizendeFlaeche"
},
{
"type": "text",
"name": "Projektbeginn",
"label": "Projektbeginn"
},
{
"type": "text",
"name": "KontaktaufnahmeMoeglichAb",
"label": "KontaktaufnahmeMoeglichAb"
},
{
"type": "text",
"name": "Erreichbarkeit",
"label": "Erreichbarkeit"
},
{
"type": "text",
"name": "ArtDesObjekts",
"label": "ArtDesObjekts"
},
{
"type": "text",
"name": "AktuellBenutzteHeizung",
"label": "AktuellBenutzteHeizung"
},
{
"type": "text",
"name": "Eigentumsverhaeltnisse",
"label": "Eigentumsverhaeltnisse"
},
{
"type": "text",
"name": "nVorhandene",
"label": "nVorhandene"
},
{
"type": "text",
"name": "GewuenschterStandortDerHeizung",
"label": "GewuenschterStandortDerHeizung"
},
{
"type": "text",
"name": "ArtDerWaermepumpe",
"label": "ArtDerWaermepumpe"
},
{
"type": "text",
"name": "Kommentar",
"label": "Kommentar"
}
]
}
}
]
}
],
"metadata": {
"version": 1
}
}
Thank you so much, you’re my hero
No problem, glad I could help!
1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.
2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.
This marks the topic as solved, so that:
others can save time when catching up with the latest activity here, and
To do this, simply click the checkbox at the bottom of the post that answers your question:
3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!