Clean text output from Text aggregator

:bullseye: What is your goal?

Clean Text output from Text Aggregator as the output looks like this {“state”:“error”,“errorType”:“emptyDependency”,“value”:“Traditional pub with an upstairs bar, their classic décor gives the place a proper old Edinburgh feel.”,“isStale”:false} and in mapping from my Airtable search module it says {collection}

:thinking: What is the problem & what have you tried?

Added Set variable but struggle on correct Variable value

You can clean the Text aggregator output with a single Set variable right after the aggregator and then send that variable into Airtable.

trim(replace(replace(replace(1.text;“\r\n”;" ");“\n”;" ");“\r”;" "))

I hope this helps you!

1 Like

Welcome to the Make community!

This is an X-Y problem:

You are trying to solve problem X , and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y.source

An example of this would be trying to find a workaround to patch a problem, when you could likely fix it at the source (upstream), where it is actually happening.

e.g.:

You are trying to solve problem X (possibly parsing of a JSON result from an output of an AI module) , and you think fixing the Text aggregator would solve your problem X, but instead of asking about X when you run into trouble, you ask about fixing the Text aggregator.

Perhaps you can tell us what the rest of your scenario is doing instead of just fixing the output of the Text aggregator, which may or may not be the best way to implement and achieve the desired result? This way, you can get more useful advice.

Hope this helps! If you are still having trouble, please provide more details.

@samliew

1 Like

Thanks for the advice and very true. The rest of the flow is from the text aggregator to a HTTP module that send a message to my staff. The text aggregator input I get comes from a airtable search module and extract the from a airtble column that is AI generated text.

Thanks very much Karmic, now trying your solution

Nope, tried every possible solution still nothing and herewith my flow and thanks in advance:

We’d love to help, however, we require more information that demonstrates the problem to help us reproduce the scenario and any issues and errors.

To allow others to assist you, please provide the following:

1. All Relevant Screenshots

We need to see what you’re working with to give you the best advice. Screenshots are important because Make is a visual editor — a picture provides us with more context.

It would help us identify the issue by having screenshots of:

  • the full scenario, and the zoomed in parts of the scenario that you are referring to (if your scenario is huge),
  • a full scenario run/execution from the history (showing output “speech” bubbles),
  • relevant module fields (showing how you’ve used any built-in functions, and how you’ve mapped the variables),
  • relevant filters between modules (showing which operators and any built-in functions you’ve used, and how you’ve mapped the variables),
  • relevant module input/output bubbles,
  • if applicable, any error messages,
  • and if applicable, any external services (spreadsheet headers/ sample data/ regex101.com/ etc. to show the item/ record exists, and is set up correctly).
Need help❓View instructions ◀

We would appreciate it if you could directly upload screenshots here instead of linking to them outside of this forum. This allows us to zoom in on the image when clicked, and also having improved privacy from third-party sources.

Taking Screenshots

  • Microsoft Windows: Take screenshots using the “Windows Snipping Tool”, by pressing either PrtSc or WinShiftS keys on your keyboard.
  • MacOS: Take screenshots by pressing CommandShift4 keys on your keyboard.

Uploading Attachments

  • Drag image files directly into the rich-text editor, or
  • Click on the upload button in the editor toolbar to select files:

2. Scenario Blueprint

Providing your scenario will allow others to quickly recreate and see how you have set up the mappings in each module, and also allows us take screenshots or provide module exports of any solutions we have for you in return. This would benefit you in implementing our suggestions as you can view screenshots of the changes or paste corrected modules back into your scenario.

Need help❓View instructions ◀

A. Export Blueprint

In the scenario editor, click the three dots at the top-right, then select “Export blueprint”.

  • You can upload files and images to this forum by clicking on the upload button:

    Uploading an attachment here will look like this:
    blueprint.json (12.3 KB)

B. Create Public Share Link

In the scenario editor, click on the Share button:

Read more about the scenario sharing feature in the Help Centre.

3. Properly-formatted Output Bundles from a Scenario Run

Please provide the input/output bundles of each of the relevant modules by running the scenario, or get the bundles from a previous run from the Scenario “History” tab.

Providing the bundles from a scenario run will allow others to replicate what is going on, especially if there are complex data structures (nested arrays and collections) and external services. This helps mapping the correct raw variable names from collections (instead of the label/display name).

Need help❓View instructions ◀

Click on the white speech bubbles on the top-right of each module and select “Download output (or input) bundles”.

A. Upload a Text File

Save each bundle contents in a plain text editor as a moduleNumber-output.txt file. Open the file to check if it has not added additional formatting or encoded the plain text.

  • You can upload files and images to this forum by clicking on the upload button:

    Uploading an attachment here will look like this:
    module1-input.txt (1.2 KB)
    module1-output.txt (3.4 KB)

B. Insert a Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the bundles AND format them correctly.

:warning: Formatting IS Important! :warning:

Here are some ways to provide text content in a way that it won’t be modified by the forum.

  • Method 1: Type code fence manually
    Manually type three backticks ``` in a separate line before and after the content, like this,

    ```
    text goes here
    ```
    
  • Method 2: Highlight the pasted content, then click the preformatted text/code button

  • Method 3: Upload your file elsewhere and share the public link
    This method is only advised for large files exceeding the forum upload limit.

Sharing these details will make it easier for others to assist you, so that you can get better answers, faster.

Hope this helps! If you are still having trouble, please provide more details.

@samliew