<?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>topic Chatlayer ResponseBuilder in Developer Forum</title>
    <link>https://community.sinch.com/t5/Developer-Forum/Chatlayer-ResponseBuilder/m-p/17964#M197</link>
    <description>&lt;P&gt;Hi Community,&lt;BR /&gt;&lt;BR /&gt;For a voicebot in Chatlayer I need to strip characters from an input, when asked e.g. a customer number. When the input is "Yes, my number is 123456" I only want to capture the 123456. I tried with a regex in an collect input block and store the value in a variable, but that does not work.&amp;nbsp;&lt;BR /&gt;Secondly I tried to use the initial input variable and use the Action Block with a Code action to code a ResponseBuilder as described in&amp;nbsp;&lt;A href="https://docs.chatlayer.ai/integrateandcode/code-action" target="_blank"&gt;https://docs.chatlayer.ai/integrateandcode/code-action&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here I am trying to use the initial variable, use a regex to clean up the input and store the output it in a second variable. This would then be digits only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone solved this or has any other way of cleaning an input?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 06 Mar 2025 13:14:28 GMT</pubDate>
    <dc:creator>Edwin_Wortel</dc:creator>
    <dc:date>2025-03-06T13:14:28Z</dc:date>
    <item>
      <title>Chatlayer ResponseBuilder</title>
      <link>https://community.sinch.com/t5/Developer-Forum/Chatlayer-ResponseBuilder/m-p/17964#M197</link>
      <description>&lt;P&gt;Hi Community,&lt;BR /&gt;&lt;BR /&gt;For a voicebot in Chatlayer I need to strip characters from an input, when asked e.g. a customer number. When the input is "Yes, my number is 123456" I only want to capture the 123456. I tried with a regex in an collect input block and store the value in a variable, but that does not work.&amp;nbsp;&lt;BR /&gt;Secondly I tried to use the initial input variable and use the Action Block with a Code action to code a ResponseBuilder as described in&amp;nbsp;&lt;A href="https://docs.chatlayer.ai/integrateandcode/code-action" target="_blank"&gt;https://docs.chatlayer.ai/integrateandcode/code-action&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here I am trying to use the initial variable, use a regex to clean up the input and store the output it in a second variable. This would then be digits only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone solved this or has any other way of cleaning an input?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 13:14:28 GMT</pubDate>
      <guid>https://community.sinch.com/t5/Developer-Forum/Chatlayer-ResponseBuilder/m-p/17964#M197</guid>
      <dc:creator>Edwin_Wortel</dc:creator>
      <dc:date>2025-03-06T13:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Chatlayer ResponseBuilder</title>
      <link>https://community.sinch.com/t5/Developer-Forum/Chatlayer-ResponseBuilder/m-p/17966#M198</link>
      <description>&lt;P&gt;Hi Edwin,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your query.&amp;nbsp; Let me reach out to the Chatlayer team and I will get abck to you with some guidance on how best to proceed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and kind regards,&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 14:21:04 GMT</pubDate>
      <guid>https://community.sinch.com/t5/Developer-Forum/Chatlayer-ResponseBuilder/m-p/17966#M198</guid>
      <dc:creator>Shahzad_Ismail</dc:creator>
      <dc:date>2025-03-07T14:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Chatlayer ResponseBuilder</title>
      <link>https://community.sinch.com/t5/Developer-Forum/Chatlayer-ResponseBuilder/m-p/17971#M199</link>
      <description>&lt;P&gt;Hi Shahzad,&lt;/P&gt;&lt;P&gt;I asked internally some coders and they came up with this working solution:&lt;/P&gt;&lt;P&gt;First I collect input in a variable {Cust_ID}&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I use the Action node with a code action. I assign as argument a new variable &lt;EM&gt;CustID&amp;nbsp;&lt;/EM&gt;with value of &lt;EM&gt;Cust_ID&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Then I was given this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;let ID = args.CustID&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;ChatlayerResponseBuilder()&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; .addSessionVariable("Cust_ID2", ID.replace(/\D/g, ''))&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; .send();&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Result was variable Cust_ID2 was populated with the stripped digits from Variable Cust_ID.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In a message node I output the value of variable Cust_ID2 with&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;lt;speak&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;So your customer number is: &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;lt;break time="1s"/&amp;gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;lt;say-as interpret-as="characters"&amp;gt;{Cust_ID2}&amp;lt;/say-as&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;/speak&amp;gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;for the user to confirm with yes or no before proceeding.&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a working solution, but when you have better ideas, I'd love to hear them.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Edwin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:59:07 GMT</pubDate>
      <guid>https://community.sinch.com/t5/Developer-Forum/Chatlayer-ResponseBuilder/m-p/17971#M199</guid>
      <dc:creator>Edwin_Wortel</dc:creator>
      <dc:date>2025-03-11T14:59:07Z</dc:date>
    </item>
  </channel>
</rss>

