<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Is not a function error in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659883#M4749558</link>
    <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;thomas.jentsch&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your answer. Can you share your example please? Because I've also tried with a basic automation (2 consecutive custom scripts with &lt;EM&gt;return input.match(MyRegex);&lt;/EM&gt; functions) and it still does not work on my side. I really don't see how I could do it any differently...&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;LM.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2022 12:22:00 GMT</pubDate>
    <dc:creator>Ludovic_MOOS</dc:creator>
    <dc:date>2022-12-12T12:22:00Z</dc:date>
    <item>
      <title>Is not a function error</title>
      <link>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaq-p/12659880</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I've been facing an issue for quite a long time now, which I've always managed to bypass so far but it has become so critical it really blocks my project now. Let me explain:&lt;/P&gt;
  &lt;P&gt;I created a custom script containing a regular expression, the activity (#29) works well and generates a proper output (a 2 or 3 digit number):&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2118774-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2118775-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;However, each time I add another custom script right after an existing custom script (selecting the previous custom script output as input: what I'm trying to do here is to "clean" the previous custom script output in case it contains unwanted characters) and I run the automation, the second custom script results in the following error message "input.match is not a function" (note that both custom script activities have the same kind of function: return input.match(MyRegex);):&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2118781-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2118778-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;In the above screenshots, the first custom script is part of a Try/Catch Control, but even when not using a Try/Catch control, the second custom script always results in the same kind of error message "input.match is a not a function", whereas both regex work fine and each custom script performs well when "standing alone".&lt;/P&gt;
  &lt;P&gt;What am I missing here? Does anyone have a clue?&lt;/P&gt;
  &lt;P&gt;Thanks for your help.&lt;/P&gt;
  &lt;P&gt;Best regards,&lt;/P&gt;
  &lt;P&gt;LM.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 23:25:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaq-p/12659880</guid>
      <dc:creator>Ludovic_MOOS</dc:creator>
      <dc:date>2022-12-08T23:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is not a function error</title>
      <link>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659881#M4749556</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;chaitanyapriya.puvvada&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Would you have any idea regarding this issue?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 10:26:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659881#M4749556</guid>
      <dc:creator>Ludovic_MOOS</dc:creator>
      <dc:date>2022-12-09T10:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is not a function error</title>
      <link>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659882#M4749557</link>
      <description>&lt;P&gt;Could not reproduce the issue with a simple example.&lt;BR /&gt;Can you try to have both calls in just one custom script ?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 07:54:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659882#M4749557</guid>
      <dc:creator>TJe</dc:creator>
      <dc:date>2022-12-12T07:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is not a function error</title>
      <link>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659883#M4749558</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;thomas.jentsch&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your answer. Can you share your example please? Because I've also tried with a basic automation (2 consecutive custom scripts with &lt;EM&gt;return input.match(MyRegex);&lt;/EM&gt; functions) and it still does not work on my side. I really don't see how I could do it any differently...&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;LM.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 12:22:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659883#M4749558</guid>
      <dc:creator>Ludovic_MOOS</dc:creator>
      <dc:date>2022-12-12T12:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is not a function error</title>
      <link>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659884#M4749559</link>
      <description>&lt;P&gt;Guess come closer to the problem now.&lt;BR /&gt;I'm not an expert of regular expression, but seems that match() returns an array and not a string.&lt;BR /&gt;Here a sample with an empty regular expression:&lt;/P&gt;var a = input.match();return a[0].match();&lt;BR /&gt;&lt;P&gt;If you want to return a string, you need to return the first element from the array.&lt;BR /&gt;And here you can add the second match() already.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 13:49:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659884#M4749559</guid>
      <dc:creator>TJe</dc:creator>
      <dc:date>2022-12-12T13:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is not a function error</title>
      <link>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659885#M4749560</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;thomas.jentsch&lt;/SPAN&gt;,&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I always had a feeling about this array thing but never managed to figure it out &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; It seems to be running well when I change the function of my 2nd custom script for return[0].match(MyRegex);&lt;/P&gt;&lt;P&gt;Thanks for the lead and help.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;LM.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 15:30:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/is-not-a-function-error/qaa-p/12659885#M4749560</guid>
      <dc:creator>Ludovic_MOOS</dc:creator>
      <dc:date>2022-12-12T15:30:57Z</dc:date>
    </item>
  </channel>
</rss>

