<?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: Recursion Error, How to Loop skills and how to do variable type conversions in sap CAI? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaa-p/12254391#M4589308</link>
    <description>&lt;P&gt;Hi Kishore,&lt;/P&gt;&lt;P&gt;please have a look at the newly released "Custom" send message type. You can use scripting to build up the list entries dynamically by looping through the API service response.&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Jonas&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jul 2020 07:25:03 GMT</pubDate>
    <dc:creator>JonasB</dc:creator>
    <dc:date>2020-07-30T07:25:03Z</dc:date>
    <item>
      <title>Recursion Error, How to Loop skills and how to do variable type conversions in sap CAI?</title>
      <link>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaq-p/12254388</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I want to loop a skill, so I created variable "&lt;STRONG&gt;i&lt;/STRONG&gt;" and set to &lt;STRONG&gt;0&lt;/STRONG&gt; and "&lt;STRONG&gt;n&lt;/STRONG&gt;" and set to &lt;STRONG&gt;"{{length api_service_response.products.body.value}}"&lt;/STRONG&gt; and calling a skill which is having the IF condition that is &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1829497-set-memory.jpg" /&gt; &lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1829498-memory.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1829500-condition.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;but it is not taking n value as integer value, and i am getting the error&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1829499-warning.jpg" /&gt; &lt;/P&gt;
  &lt;P&gt;so I have changed the condition and calling the same skill but still facing recursion error&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1829501-recursion.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1829502-recursionerr.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;Basically i want to use the memory variable&lt;STRONG&gt; "i" &lt;/STRONG&gt;in "{{api_service_response.products.body.value.[&lt;STRONG&gt;memory.i&lt;/STRONG&gt;].ProductID}}" and print an array of values by recursion, I am getting result as null, &lt;/P&gt;
  &lt;P&gt;how to do print array values dynamically in CAI, how to change string values to integer values?&lt;/P&gt;
  &lt;P&gt;you can find the bot here &lt;A href="https://cai.tools.sap/kishorech/recursionbot/train/intents"&gt;https://cai.tools.sap/kishorech/recursionbot/train/intents&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;can you help me here&lt;BR /&gt;Thanks&lt;BR /&gt;Kishore&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 02:01:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaq-p/12254388</guid>
      <dc:creator>former_member671720</dc:creator>
      <dc:date>2020-07-17T02:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion Error, How to Loop skills and how to do variable type conversions in sap CAI?</title>
      <link>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaa-p/12254389#M4589306</link>
      <description>&lt;P&gt;Hi Kishore,&lt;/P&gt;&lt;P&gt;in the Edit Memory action, scripting can currently only be used inside strings, so you cannot use it to put a variable as number into the memory. This will be changed in a future release by providing the option to use scripting for building up the JSON.&lt;/P&gt;&lt;P&gt;In regards to the recursion I don't fully understand what you're trying to achieve. I think the error message is quite clearly saying that you should not use a go-to action pointing to the same skill. Why don't you use a loop as part of the scripting instead?&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Jonas&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 13:00:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaa-p/12254389#M4589306</guid>
      <dc:creator>JonasB</dc:creator>
      <dc:date>2020-07-17T13:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion Error, How to Loop skills and how to do variable type conversions in sap CAI?</title>
      <link>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaa-p/12254390#M4589307</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;jonas.brand&lt;/SPAN&gt;, Thanks for your response,&lt;/P&gt;&lt;P&gt;I am doing an API get request and the response has an array, so I want to have show output as &lt;STRONG&gt;LIST&lt;/STRONG&gt; for each entry of the response array and &lt;STRONG&gt;not&lt;/STRONG&gt; as a single &lt;STRONG&gt;TEXT &lt;/STRONG&gt;output, so i am trying to do recursion by giving condition as response array length which is a dynamic value.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ex: &lt;/STRONG&gt;if my array is having 6 entries, then i would like to print 6 LIST's to the chat output ...like this shown below&lt;/P&gt;&lt;P&gt;  &lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1829550-arraylist2.jpg" /&gt;&lt;/P&gt;&lt;P&gt;I know as of now in CAI we don't have this functionality. So, I am trying to show output in a list but by passing different index value on each call, &lt;/P&gt;&lt;P&gt;so I have created a variable &lt;STRONG&gt;i &lt;/STRONG&gt;and set it to zero and &lt;/P&gt;&lt;P&gt;and i am doing increment by one in each call i am printing {{api_service_response.products.body.value.[&lt;STRONG&gt;memory.i&lt;/STRONG&gt;].ProductName}} in place of {{api_service_response.products.body.value.[&lt;STRONG&gt;INDEX&lt;/STRONG&gt;].ProductName}} in the List.&lt;/P&gt;&lt;P&gt;so that i can get the output as &lt;BR /&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1829549-arraylist.jpg" /&gt;&lt;/P&gt;&lt;P&gt;Is there any other way that i can show my array entry as a LIST with out doing the recursion ?&lt;/P&gt;&lt;P&gt;is there any better way of doing the recursion ?&lt;/P&gt;&lt;P&gt;Please let me know if this is possible &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kishore&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 14:31:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaa-p/12254390#M4589307</guid>
      <dc:creator>former_member671720</dc:creator>
      <dc:date>2020-07-17T14:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion Error, How to Loop skills and how to do variable type conversions in sap CAI?</title>
      <link>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaa-p/12254391#M4589308</link>
      <description>&lt;P&gt;Hi Kishore,&lt;/P&gt;&lt;P&gt;please have a look at the newly released "Custom" send message type. You can use scripting to build up the list entries dynamically by looping through the API service response.&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Jonas&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 07:25:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/recursion-error-how-to-loop-skills-and-how-to-do-variable-type-conversions/qaa-p/12254391#M4589308</guid>
      <dc:creator>JonasB</dc:creator>
      <dc:date>2020-07-30T07:25:03Z</dc:date>
    </item>
  </channel>
</rss>

