Extract keys and values from email text

Hello,

I need help with a scenario. I regularly receive emails like the one listed below. The emails are always the same format with the only values changing being the text in “”. How can I make a scenario that can ingest this data, convert it to keys and values and then send it via webhook to another endpoint? I also want to make an array of anything that comes after the line “URL Link to the media files in the S3 bucket:”

Tour ID: “653d5389cfeecc4f1232f83b”;

Tour theme ID: “631127abfcd5c60182ebb35f”;

Account name: “nbean”;

Account email: “nbean@sares-regis.com”;

Client: “5d9df3265d985a294d628c21”;

Title: “The Heights at Park Lane Apartments”;

Building name: “Flats”;

Parent tour: “631127fcd1c9000190db079f”;

Parent tour theme ID: “631127abfcd5c60182ebb35f”;

Unit number: “F719”;

Amenity name: “”;

Street view connections URL: “https://login.tourbuilder.com/#/tour/streetview/create/5d9df3265d985a294d628c21/Sares%20Regis:::5…”;

TourBuilder URL: “TourBuilder (c) 2023 - Virtual Tour Builder”;

Add scenes to the main tour: “false”;

Floor plan type: “F19”;

Camera id: “YN34113139”;

Tour type: “unit”;

other_property_type_name: “”;

URL Link to the media files in the S3 bucket:

Scene “Hallway”: Hallway
Scene “Hallway”: Hallway
Scene “Bathroom”: Bathroom
Scene “Hallway”: Hallway
Scene “Study room”: Study room
Scene “Kitchen”: Kitchen
Scene “Kitchen”: Kitchen
Scene “Kitchen”: Kitchen
Scene “Living Room”: Living Room
Scene “Living Room”: Living Room
Scene “Balcony”: Balcony
Scene “Living Room”: Living Room
Scene “Primary bedroom”: Primary bedroom
Scene “Primary bedroom”: Primary bedroom
Scene “Primary bedroom”: Primary bedroom
Scene “Primary bedroom”: Primary bedroom
Scene “Primary bedroom”: Primary bedroom
Scene “Primary bathroom”: Primary bathroom
Scene “Primary bathroom”: Primary bathroom
Scene “Primary bathroom”: Primary bathroom
Nav. data: indoor_data.json

Hi Nick,

You can use the Text Parser Match Elements module to extract the pieces of data from the text.

Then, you have use HTTP Module to pass the data on to another endpoint.

2 Likes

Thanks for the input! When I do that, it only allows me to map the first key and value rather than all 62 that should have been generated. (When I click in to the parse text response it shows 62 output bundles) See screen shot.

Welcome to the Make community!

That is fine if you want to run the next module 62 times, once per match.

If you want to merge all matches,

Every result (item/record) from a search/match module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and has applies to many use-cases.

There are other types of aggregator modules, click the below links to find out more:

Alternatively, your regular expression pattern is wrong or incorrect, and could possibly be improved.

If you need further assistance, please provide the following:

1. Screenshots of module fields and filters

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:
Screenshot_2023-10-07_111039

2. Scenario blueprint

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.

Screenshot_2023-08-24_230826
(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)

3. And most importantly, Output bundles

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”.
Screenshot_2023-10-06_141025

A.

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)

B.

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:
    Screenshot_2023-10-02_191027

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!

3 Likes