Value sometimes truncated in module Match Elements in Text Parser using key/value pairs

I am using the “Match element” module in the Text parser. This allows you to use a key/value pair parser using a custom delimiter. The module is working well, except for a few key value pairs, where it gets the key right but TRUNCATES the value at some arbitrary point.

Here is the configuration:

Here’s the input bundle and one truncated value

Here are a few more truncated and correct examples:

Here’s a sample raw Input into the module:

"notes": "Requester Name:\nthis is a very long name\n\nEmail address of requester:\nsupport@newpathconsulting.com\n\nEmail Address of Customer Contact:\nasirota+test@gmail.com\n\nFirst Name of Customer Contact:\nAlexander\n\nWhat is the Inventory ID for this item?:\n100\n\nLink to Item in Acumatica:\n100\n\nIs this item printed?:\nNo\n\nIs this item diecut?:\nNo\n\nWill we be warehousing this item?:\nNo\n\nDelivery of first order date?:\nOct 10, 2022\n\n———————————————\nThis task was submitted through Item Onboarding Request\nhttps://form.asana.com/?k=8mICnHTtDzxx7yBVw3XJ2w&d=540960823070032"

Lol that’s really weird! As far as I can see it, it always truncates after a “n”.

“… very long name” → “…very lo”
“support@newpath” → “support@”
“Alexander” → “Alex”

Does the “:” remove the “/” from the newline “/n”? You might try to use online “newline” as a Delimiter and then remove the “:” afterwards?

Best,
Richard

Using newline only as the delimiter breaks any key value pair with an n in it into the key and value. I need both :\n as the delimiter.

This looks like a bug for sure but I think you nailed where the bug is. The newline delimiter is using the “n” of the word new line to truncate the value incorrectly. Newline should be escaped somehow

In the meantime I’ll strip out the newline from the notes text string in the parser and use just : as a delimiter. Thank you!

1 Like

Well something is really broken with Match element. I eliminated the newline as a delimiter and just kept it between the key/value pairs. I replaced the : delimiter with :: and the ‘n’ character still truncates the parsing as before. Except now I have an extra : which seems to not be removed, so it is worse than before:

Here’s the configuration with my nested replace()s to remove the newlines, replace with ==, then change single new lines with a : and finally remove the == with 1 newine)

The output is still truncating with the n being the truncation demarcation point.

1 Like

Can’t decide between laughing and crying :smiley:
Sadly, I run out of ideas “to fix it” :confused:

No matter what I try, even:

{{replace(replace(3.notes; newline + newline; newline + “=” + newline); “:” + newline; “:”)}}

Which generates a nice text block like so:

Requestor Name:Alex
=
Email address of requester:alexs@newpathconsulting.com
=
Email Address of Customer Contact:Mary@newpathconsulting.com
=
First Name of Customer Contact:Mary
=
What is the Inventory ID for this item?:MARY
=
Customer Name:Korpack
=
Link to Item in Acumatica:https://newpathconsulting.com
=
Is this printed?:Yes
=
Is this print black only?:No
=
Have we printed this color(s) previously for this customer on this material?:Yes
=
Is this item diecut?:No
=
Will we be warehousing this item?:No
=
Delivery of first order date?:Dec 29, 2022
=

Still outputs truncated values:

[
    {
        "match": "Requestor Name:Alex",
        "key": "Requestor Name",
        "value": "Alex"
    },
    {
        "match": "Email address of requester:alexs@",
        "key": "Email address of requester",
        "value": "alexs@"
    },
    {
        "match": "Email Address of Customer Contact:Mary@korpack.com",
        "key": "Email Address of Customer Contact",
        "value": "Mary@korpack.com"
    },
    {
        "match": "First Name of Customer Contact:Mary",
        "key": "First Name of Customer Contact",
        "value": "Mary"
    },
    {
        "match": "What is the Inventory ID for this item?:MARY",
        "key": "What is the Inventory ID for this item?",
        "value": "MARY"
    },
    {
        "match": "Customer Name:Korpack",
        "key": "Customer Name",
        "value": "Korpack"
    },
    {
        "match": "Link to Item in Acumatica:https://",
        "key": "Link to Item in Acumatica",
        "value": "https://"
    },
    {
        "match": "Is this printed?:Yes",
        "key": "Is this printed?",
        "value": "Yes"
    },
    {
        "match": "Is this print black only?:No",
        "key": "Is this print black only?",
        "value": "No"
    },
    {
        "match": "Have we printed this color(s) previously for this customer on this material?:Yes",
        "key": "Have we printed this color(s) previously for this customer on this material?",
        "value": "Yes"
    },
    {
        "match": "Is this item diecut?:No",
        "key": "Is this item diecut?",
        "value": "No"
    },
    {
        "match": "Will we be warehousing this item?:No",
        "key": "Will we be warehousing this item?",
        "value": "No"
    },
    {
        "match": "Delivery of first order date?:Dec 29, 2022",
        "key": "Delivery of first order date?",
        "value": "Dec 29, 2022"
    },
    {
        "match": "https://form.asa",
        "key": "https",
        "value": "//form.asa"
    }
]

Next I am going to try escaping n’s and converting them to ~ and then replacing ~ with n’s elsewhere.

This is an insane workaround! The worst I have seen in my 4+ years working with Make/Integromat:

I need to use this replace() expression to remove the n’s so they don’t truncate the value:

{{replace(3.notes; "n"; "~")}}

This eliminates the truncating but now I have the pleasure of switching the ~ back to n’s in the resulting array I am aggregating.

[
    {
        "match": "Requestor Name:\nAlex",
        "key": "Requestor Name",
        "value": "Alex"
    },
    {
        "match": "Email address of requester:\nalexs@~ewpathco~sulti~g.com",
        "key": "Email address of requester",
        "value": "alexs@~ewpathco~sulti~g.com"
    },
    {
        "match": "Email Address of Customer Co~tact:\nMary@~ewpathco~sulti~g.com",
        "key": "Email Address of Customer Co~tact",
        "value": "Mary@~ewpathco~sulti~g.com"
    },
    {
        "match": "First Name of Customer Co~tact:\nMary",
        "key": "First Name of Customer Co~tact",
        "value": "Mary"
    },
    {
        "match": "What is the I~ve~tory ID for this item?:\nMARY",
        "key": "What is the I~ve~tory ID for this item?",
        "value": "MARY"
    },
    {
        "match": "Customer Name:\nNewPath",
        "key": "Customer Name",
        "value": "NewPath"
    },
    {
        "match": "Li~k to Item i~ Acumatica:\nhttps://~ewpathco~sulti~g.com",
        "key": "Li~k to Item i~ Acumatica",
        "value": "https://~ewpathco~sulti~g.com"
    },
    {
        "match": "Is this pri~ted?:\nYes",
        "key": "Is this pri~ted?",
        "value": "Yes"
    },
    {
        "match": "Is this pri~t black o~ly?:\nNo",
        "key": "Is this pri~t black o~ly?",
        "value": "No"
    },
    {
        "match": "Have we pri~ted this color(s) previously for this customer o~ this material?:\nYes",
        "key": "Have we pri~ted this color(s) previously for this customer o~ this material?",
        "value": "Yes"
    },
    {
        "match": "Is this item diecut?:\nNo",
        "key": "Is this item diecut?",
        "value": "No"
    },
    {
        "match": "Will we be warehousi~g this item?:\nNo",
        "key": "Will we be warehousi~g this item?",
        "value": "No"
    },
    {
        "match": "Delivery of first order date?:\nDec 29, 2022",
        "key": "Delivery of first order date?",
        "value": "Dec 29, 2022"
    }
]

And here’s my set variable change from ~ back to n in the key and value, and the resulting arrray aggregator to get all the found key/value pair collections into 1 array:


And finally my beautiful array note “Frank” was not truncated and neither was Link to Item in Acumatica value URL which has an n in Main.

[
    {
        "array": [
            {
                "key": "Requestor Name",
                "value": "Maggie"
            },
            {
                "key": "Email address of requester",
                "value": "maggie@newpath.com"
            },
            {
                "key": "Email Address of Customer Contact",
                "value": "yest@google.com"
            },
            {
                "key": "First Name of Customer Contact",
                "value": "Frank"
            },
            {
                "key": "What is the Inventory ID for this item?",
                "value": "K3319204KN5215"
            },
            {
                "key": "Customer Name",
                "value": "Vital"
            },
            {
                "key": "Link to Item in Acumatica",
                "value": "https://acumatica.korpack.com/KORPACK_ERP/(W(10042))/Main?ScreenId=PO301000&OrderType=RO&OrderNbr=037108"
            },
            {
                "key": "Is this printed?",
                "value": "No"
            },
            {
                "key": "Is this item diecut?",
                "value": "Yes"
            },
            {
                "key": "Will we be warehousing this item?",
                "value": "No"
            },
            {
                "key": "Delivery of first order date?",
                "value": "Nov 14, 2022"
            }
        ],
        "__IMTAGGLENGTH__": 11
    }
]

The Match Element work around to eliminate truncating values with “n” in them:

1 Like

I got a note from support that this issue has been fixed. I’ll have a look later today to see if that is true.

1 Like

The Text Pattern - Match Elements module has finally been fixed. See the test below:

1 Like