<?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 Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - &amp;quot;Reverse APIs&amp;quot;) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773366#M2029395</link>
    <description>&lt;P&gt;Awesome, well spotted. Mea culpa. Corrected (function -&amp;gt; action). Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 12:31:39 GMT</pubDate>
    <dc:creator>qmacro</dc:creator>
    <dc:date>2024-07-26T12:31:39Z</dc:date>
    <item>
      <title>Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13772607#M2029379</link>
      <description>&lt;P&gt;This is a task in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/application-development-blog-posts/2024-07-quot-reverse-apis-quot-sap-developer-challenge/ba-p/13749653" target="_blank" rel="nofollow noopener"&gt;July Developer Challenge - "Reverse APIs"&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;In this task you'll define and implement an unbound action, that does something that you might remember from the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-developer-challenge-apis/ba-p/13573168" target="_blank" rel="nofollow noopener"&gt;Developer Challenge on APIs last year in August&lt;/A&gt;, and you'll end up writing some (hopefully) interesting code for the implementation.&lt;/P&gt;&lt;H2&gt;Background&lt;/H2&gt;&lt;P&gt;Last year we ran a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-developer-challenge-apis/ba-p/13573168" target="_blank" rel="nofollow noopener"&gt;Developer Challenge on APIs&lt;/A&gt;. In one of the tasks -&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/application-development-discussions/sap-developer-challenge-apis-task-3-have-a-northbreeze-product-selected-for/m-p/277972" target="_blank" rel="nofollow noopener"&gt;Task 3 - Have a Northbreeze product selected for you&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- you needed to make a call to an API endpoint supplying your SAP Community ID and it would return a Northwind product. In the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/application-development-discussions/sap-developer-challenge-apis-task-3-have-a-northbreeze-product-selected-for/m-p/277972#toc-hId--900893759" target="_blank" rel="nofollow noopener"&gt;example&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for my ID, "qmacro", it showed this being returned:&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;{
  &lt;SPAN class=""&gt;"@odata.context"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;$metadata#Edm.String&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
  &lt;SPAN class=""&gt;"value"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;Rössle Sauerkraut&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
}&lt;/PRE&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;In other words, the product "corresponding to" my SAP Community ID is "Rössle Sauerkraut". Different products were returned for different SAP Community IDs, so that your answers would be different to each other. The calculation of&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;which&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;product to return was based on the value of your SAP Community ID.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;In this task, you will need to define an API endpoint, in the form of an unbound action, and write the implementation to calculate, look up and return the name of a product that corresponds to the SAP Community ID that is sent by the TESTER.&lt;/P&gt;&lt;H3&gt;Correspondence calculation&lt;/H3&gt;&lt;P&gt;So how should you determine which product to select for a given SAP Community ID? The same way that it was determined in last year's Developer Challenge for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/application-development-discussions/sap-developer-challenge-apis-task-3-have-a-northbreeze-product-selected-for/m-p/277972" target="_blank" rel="nofollow noopener"&gt;that task&lt;/A&gt;. And that is to turn the SAP Community ID string value into a numeric value, and then use that to select a specific product with an ID (in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ProductID) that matches that numeric value.&lt;/P&gt;&lt;P&gt;Here's the logic:&lt;/P&gt;&lt;P&gt;First:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ensure the SAP Community ID is all lower case&lt;/LI&gt;&lt;LI&gt;convert each character to its equivalent decimal ASCII code&lt;/LI&gt;&lt;LI&gt;add the resulting list of ASCII codes together to make a total&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Then:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;determine how many products are in your Northbreeze data&lt;/LI&gt;&lt;LI&gt;read a single product where the key is the ASCII codes total value&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Noting that:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you will need to use modulo arithmetic to ensure that the ASCII codes total value falls within the range between 1 and the total number of Northbreeze products&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;And here's an example of that logic in action, where (for the sake of illustration) the SAP Community ID value "QmacrO" is sent in the payload of the HTTP request:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;converting "QmacrO" to lower case gives "qmacro"&lt;/LI&gt;&lt;LI&gt;the decimal ASCII codes for "qmacro" are 113, 109, 97, 99, 114 and 111&lt;/LI&gt;&lt;LI&gt;added together, these codes come to 643&lt;/LI&gt;&lt;LI&gt;there are&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://qmacro.cfapps.eu10.hana.ondemand.com/northbreeze/Products/$count" target="_blank" rel="nofollow noopener"&gt;77 Northbreeze products&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;using modulo arithmetic to turn 643 into a number between 1 and 77, it becomes 28&lt;/LI&gt;&lt;LI&gt;the product with ID 28 is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://qmacro.cfapps.eu10.hana.ondemand.com/northbreeze/Products/28" target="_blank" rel="nofollow noopener"&gt;Rössle Sauerkraut&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Be careful with the modulo calculation, because you need to take into account that the result of a modulo calculation could be 0, which is not in the ID range. It would also never be 77. This is why 643 modulo 77 becomes 28, not 27 (basically, do the modulo calculation and add 1).&lt;/P&gt;&lt;P&gt;Clearly these instructions have already told you that there are 77 products. You should have 77 products too if you&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/application-development-discussions/task-7-using-cql-in-an-unbound-function-implementation-july-developer/td-p/13767476#toc-hId-952949467" target="_blank" rel="nofollow noopener"&gt;started with the repo as recommended&lt;/A&gt;. Nevertheless, we encourage you to use some CQL in your implementation to programatically determine how many products there are, not just set the value&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;77&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in a constant &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;H2&gt;The requirements&lt;/H2&gt;&lt;P&gt;Here are the specific requirements for this task.&lt;/P&gt;&lt;P&gt;Add an unbound action called&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;selectProduct&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to the definition of your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;northbreeze&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;service. It should expect a String value for a single parameter named&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;communityid, and it should return the same type as the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ProductName&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;element in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Products&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;entity type.&lt;/P&gt;&lt;P&gt;Note that although you will of course be supplying your SAP Community ID as normal when you submit to the TESTER (see the next section), as usual, it will be the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;TESTER&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;that picks and sends an SAP Community ID to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;your&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;endpoint, not you, of course.&lt;/P&gt;&lt;P&gt;In the implementation, use CQL to determine the number of products you have, and then use the logic described in the "Correspondence calculation" section earlier to determine the product ID, based on the (semi-random) SAP Community ID value received. Then use CQL to retrieve that product and return the product name.&lt;/P&gt;&lt;H2&gt;Submitting to the TESTER&lt;/H2&gt;&lt;P&gt;Now you're ready to submit your CANDIDATE service, with this new API endpoint, to the TESTER!&lt;/P&gt;&lt;H3&gt;The payload&lt;/H3&gt;&lt;P&gt;The task identifier you need to supply in the payload of your submission is:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;northbreeze-selectProduct&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;You'll have already done this sort of thing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/application-development-discussions/july-developer-challenge-quot-reverse-apis-quot-task-1-your-first-service/m-p/13752205" target="_blank" rel="nofollow noopener"&gt;previously&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;so just head back there for the more detailed instructions if you need them, or to the the section titled "&lt;A href="https://community.sap.com/t5/application-development-blog-posts/2024-07-quot-reverse-apis-quot-sap-developer-challenge/ba-p/13749653#toc-hId--553513390" target="_blank" rel="nofollow noopener"&gt;The Tester service, and making a test request&lt;/A&gt;" in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/application-development-blog-posts/2024-07-quot-reverse-apis-quot-sap-developer-challenge/ba-p/13749653" target="_blank" rel="nofollow noopener"&gt;main challenge blog post&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;You'll need to submit a JSON payload like this:&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;{
  &lt;SPAN class=""&gt;"communityid"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&amp;lt;your-community-id&amp;gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
  &lt;SPAN class=""&gt;"serviceurl"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&amp;lt;the-URL-of-your-service&amp;gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
  &lt;SPAN class=""&gt;"task"&lt;/SPAN&gt;: &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;northbreeze-selectProduct&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
}&lt;/PRE&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;And, just as with the previous (and all further tasks):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;the value for the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;communityid&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;property should be your ID on this SAP Community platform (e.g. mine is "qmacro")&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;the value for the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;serviceurl&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;property should be the absolute URL (i.e. including the scheme), of your CANDIDATE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;service&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;which&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;contains&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the API endpoint (see&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sap.com/t5/application-development-blog-posts/2024-07-quot-reverse-apis-quot-sap-developer-challenge/ba-p/13749653#toc-hId--356999885" target="_blank" rel="nofollow noopener"&gt;&lt;span class="lia-unicode-emoji" title=":information:"&gt;ℹ️&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;A note on URLs and services&lt;/A&gt;).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;That's it!&lt;/P&gt;&lt;H2&gt;Logging of test results&lt;/H2&gt;&lt;P&gt;Remember that you can check on your progress, and the progress of your fellow participants - all requests are logged and are available in an entity set served by the TESTER service. The entity set URL is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developer-challenge-2024-07.cfapps.eu10.hana.ondemand.com/tester/Testlog" target="_blank" rel="nofollow noopener"&gt;https://developer-challenge-2024-07.cfapps.eu10.hana.ondemand.com/tester/Testlog&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and being an OData V4 entity set, all the normal OData system query options are available to you for digging into that information.&lt;/P&gt;&lt;P&gt;Until the next task, have fun, and if you have any questions or comments, leave them below!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 12:31:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13772607#M2029379</guid>
      <dc:creator>qmacro</dc:creator>
      <dc:date>2024-07-26T12:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13772924#M2029383</link>
      <description>&lt;P&gt;Passed &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Liyon_SV_0-1721985572088.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142125iD58DF4C3DAE47C05/image-size/medium?v=v2&amp;amp;px=400" alt="Liyon_SV_0-1721985572088.png" title="Liyon_SV_0-1721985572088.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 09:19:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13772924#M2029383</guid>
      <dc:creator>Liyon_SV</dc:creator>
      <dc:date>2024-07-26T09:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13772938#M2029384</link>
      <description>&lt;P&gt;There seems to be a slight inconsistency in the instructions. The task initially mentions creating an unbound action but then later specifies requirements for an unbound function. Or perhaps I am misunderstanding the instructions.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 09:30:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13772938#M2029384</guid>
      <dc:creator>Liyon_SV</dc:creator>
      <dc:date>2024-07-26T09:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13772973#M2029385</link>
      <description>&lt;P&gt;Passed!&lt;/P&gt;&lt;P&gt;Noticed the same as Liyon_SV and I went for the action as this is mentioned in title.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mxmw_0-1721987806891.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142147iAC26440C05760E5C/image-size/medium?v=v2&amp;amp;px=400" alt="mxmw_0-1721987806891.png" title="mxmw_0-1721987806891.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 09:57:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13772973#M2029385</guid>
      <dc:creator>mxmw</dc:creator>
      <dc:date>2024-07-26T09:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773058#M2029386</link>
      <description>&lt;P&gt;The spread operator, map and reduce come in handy here.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 10:56:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773058#M2029386</guid>
      <dc:creator>AndrewBarnard</dc:creator>
      <dc:date>2024-07-26T10:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773132#M2029387</link>
      <description>&lt;P&gt;Hi DJ,&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/53"&gt;@qmacro&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Looks like the instructions inter-twined between action and function.&lt;/P&gt;&lt;P&gt;Did build a function and couldnt get pass the tester changed it to action and it works...&lt;/P&gt;&lt;LI-CODE lang="json"&gt;{
ID: "e373bede-7a34-467c-a988-99a0017b708d",
task: "northbreeze-selectproduct",
result: "PASS",
createdAt: "2024-07-26T11:28:27.792Z",
createdBy: "anonymous",
modifiedAt: "2024-07-26T11:28:27.792Z",
modifiedBy: "anonymous",
serviceurl: "https://northbreeze-main.cfapps.us10-001.hana.ondemand.com/odata/v4/northbreeze",
communityid: "cguttikonda24"
},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Just wondering is there a fluent api approach on select to get count of records from a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 11:33:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773132#M2029387</guid>
      <dc:creator>cguttikonda24</dc:creator>
      <dc:date>2024-07-26T11:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773366#M2029395</link>
      <description>&lt;P&gt;Awesome, well spotted. Mea culpa. Corrected (function -&amp;gt; action). Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 12:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773366#M2029395</guid>
      <dc:creator>qmacro</dc:creator>
      <dc:date>2024-07-26T12:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773369#M2029396</link>
      <description>&lt;P&gt;Thanks, yes, sorry for the confusion. Definitely should be an action. Corrected.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 12:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773369#M2029396</guid>
      <dc:creator>qmacro</dc:creator>
      <dc:date>2024-07-26T12:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773372#M2029397</link>
      <description>&lt;P&gt;Lovely! You say all the right things to pique my interest! Would love to see some example from you here!&lt;/P&gt;&lt;P&gt;In wanting to generate some sample tests to use in the TESTER module for this, I generated stuff with jq, "because jq". And you wouldn't believe how lovely this was - it just flowed from my keyboard, and was instantly beautiful. Not because of my coding prowess, but because of how jq has been designed. See the `getid` function here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-26 at 13.33.28.png" style="width: 741px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142427i0093C4E003581D46/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-07-26 at 13.33.28.png" alt="Screenshot 2024-07-26 at 13.33.28.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 12:36:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773372#M2029397</guid>
      <dc:creator>qmacro</dc:creator>
      <dc:date>2024-07-26T12:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773374#M2029398</link>
      <description>&lt;P&gt;Nice work, and sorry about the confusion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You ask a good question - I'm not sure how this might work (altho I have a small brain) because we have to know the number of products in order to calculate the index, via the modulo of that number before diving in with that calculated index. That said, I'd love to hear from others who have other ideas!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 12:38:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773374#M2029398</guid>
      <dc:creator>qmacro</dc:creator>
      <dc:date>2024-07-26T12:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773525#M2029399</link>
      <description>&lt;P&gt;My submission fot task 9.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alpesa1990_0-1721998771888.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142535i14B974929F85A0D5/image-size/medium?v=v2&amp;amp;px=400" alt="Alpesa1990_0-1721998771888.png" title="Alpesa1990_0-1721998771888.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Congrats again! I faced to the same problem but&amp;nbsp;solved it by switching to unbound action.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 12:59:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773525#M2029399</guid>
      <dc:creator>Alpesa1990</dc:creator>
      <dc:date>2024-07-26T12:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773572#M2029400</link>
      <description>&lt;P&gt;Initially created an unbound function and was receiving the value correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then realized after getting an error via the deployed application that instead of function, an unbound action is expected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So changed it to action, but then started getting this error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YogSSohanee_0-1721999863776.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142570iD4A2B9F33128D09B/image-dimensions/650x184?v=v2" alt="YogSSohanee_0-1721999863776.png" title="YogSSohanee_0-1721999863776.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can anyone please help if they have encountered this or have knowledge on this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 13:18:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773572#M2029400</guid>
      <dc:creator>YogSSohanee</dc:creator>
      <dc:date>2024-07-26T13:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773582#M2029401</link>
      <description>&lt;P&gt;Rather than me tell you directly, I'll give you a hint.&lt;/P&gt;&lt;P&gt;Functions are called with GET and parameters are sent inside parentheses at the end of the URL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actions, on the other hand, are called with POST and parameters are sent in the payload of the request, usually in JSON.&lt;/P&gt;&lt;P&gt;It most likely didn't help that I confused you into creating a function first, sorry. So - just check how you're making the call to your action. It is likely / possible that you've implemented it correctly - it's just that you're calling it like a function &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 13:27:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773582#M2029401</guid>
      <dc:creator>qmacro</dc:creator>
      <dc:date>2024-07-26T13:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773680#M2029404</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/53"&gt;@qmacro&lt;/a&gt;&amp;nbsp;for your valuable suggestion. I got it working now and cleared the difference between calling Functions and Actions as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YogSSohanee_0-1722003908396.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142612i65D9B498B967DB75/image-size/medium?v=v2&amp;amp;px=400" alt="YogSSohanee_0-1722003908396.png" title="YogSSohanee_0-1722003908396.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;PFB the tester response.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YogSSohanee_1-1722003926369.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142613iAE96F9B47E5F7E03/image-dimensions/575x324?v=v2" alt="YogSSohanee_1-1722003926369.png" title="YogSSohanee_1-1722003926369.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 14:25:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773680#M2029404</guid>
      <dc:creator>YogSSohanee</dc:creator>
      <dc:date>2024-07-26T14:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773791#M2029405</link>
      <description>&lt;P&gt;A couple of curve balls in there to make things interesting. Thanks for this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="geek_0-1722012801733.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142646iEA4757DA13CBA8CE/image-size/medium?v=v2&amp;amp;px=400" alt="geek_0-1722012801733.png" title="geek_0-1722012801733.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="geek_1-1722012889708.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142648i6BE4E654C9AAD6ED/image-size/medium?v=v2&amp;amp;px=400" alt="geek_1-1722012889708.png" title="geek_1-1722012889708.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 16:55:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773791#M2029405</guid>
      <dc:creator>geek61</dc:creator>
      <dc:date>2024-07-26T16:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773982#M2029413</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2024 06:14:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773982#M2029413</guid>
      <dc:creator>qmacro</dc:creator>
      <dc:date>2024-07-27T06:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773990#M2029415</link>
      <description>&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/53"&gt;@qmacro&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK - now that your interest was piqued - here is what I did.&lt;/P&gt;&lt;P&gt;I took the communityid and using the spread operator, spread it from a String into an array of individual characters.&lt;/P&gt;&lt;P&gt;Noting that the map() method of an Array creates a new array populated with the results of calling a provided function on every element in the calling array, I used map with a function to convert to lower case and then determine the numeric value of each of the elements. ( the "characters").&lt;/P&gt;&lt;P&gt;The reduce() method of an Array executes a user-supplied "reducer" callback function on each element of the array, passing in the return value from the calculation on the preceding element "forwards". The final result of running the "reducer function" across all elements of the array is a single value.&amp;nbsp;I used reduce to sum the numeric values into one single value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here it is:&lt;/P&gt;&lt;PRE&gt;const theSum = [...communityid].map(b =&amp;gt; b.toLowerCase().charCodeAt()).reduce( (a,b) =&amp;gt; a + b )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2024 06:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13773990#M2029415</guid>
      <dc:creator>AndrewBarnard</dc:creator>
      <dc:date>2024-07-27T06:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13774014#M2029417</link>
      <description>&lt;P&gt;&amp;nbsp;my submission for task 9.Finally learned about unbound action and how to pass payload.Nice task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gphadnis2000_0-1722070734209.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142738iED3C61CE279533ED/image-size/medium?v=v2&amp;amp;px=400" alt="gphadnis2000_0-1722070734209.png" title="gphadnis2000_0-1722070734209.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2024 08:59:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13774014#M2029417</guid>
      <dc:creator>gphadnis2000</dc:creator>
      <dc:date>2024-07-27T08:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13774273#M2029423</link>
      <description>&lt;P&gt;Catching up this fantastic task during the weekend, here's my submission -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sudarshan_b_0-1722088378759.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142925i3E81ADF3C89E4B75/image-size/medium?v=v2&amp;amp;px=400" alt="sudarshan_b_0-1722088378759.png" title="sudarshan_b_0-1722088378759.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My CQL statement to determine the number of products (count) was working fine when tested locally (localhost:4004), but was failing after deploying to CF. It took me quite some time to figure out that the issue was the "count" function needs an alias to work in CF i.e.; '&lt;FONT face="courier new,courier"&gt;count(ProductID) as count&lt;/FONT&gt;'.&amp;nbsp; Strangely the "count" without alias works fine locally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, got it working with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sudarshan_b_1-1722088639931.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/142927i1BAB0B227DD12FB5/image-size/medium?v=v2&amp;amp;px=400" alt="sudarshan_b_1-1722088639931.png" title="sudarshan_b_1-1722088639931.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;New learning!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2024 21:13:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13774273#M2029423</guid>
      <dc:creator>sudarshan_b</dc:creator>
      <dc:date>2024-07-27T21:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Task 9 - Using CQL in an unbound action (July Developer Challenge - "Reverse APIs")</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13774630#M2029427</link>
      <description>&lt;P&gt;Here's my submission.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MK_0-1722188201858.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/143088i223542E3C8B422CC/image-size/medium?v=v2&amp;amp;px=400" alt="MK_0-1722188201858.png" title="MK_0-1722188201858.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Big thanks to&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/192651"&gt;@sudarshan_b&lt;/a&gt;, I ran into the very same problem and fixed it by adding an alias. The BTP application log was helpful here, but the error&amp;nbsp;&lt;SPAN&gt;"&lt;span class="lia-unicode-emoji" title=":exclamation_mark:"&gt;❗&lt;/span&gt;️Uncaught Cannot read properties of undefined (reading 'ProductName')" was not really pointing me to search for the error at the SELECT count(*)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2024 17:58:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/task-9-using-cql-in-an-unbound-action-july-developer-challenge-quot-reverse/m-p/13774630#M2029427</guid>
      <dc:creator>M-K</dc:creator>
      <dc:date>2024-07-28T17:58:54Z</dc:date>
    </item>
  </channel>
</rss>

