I was recently trying out the Couch array feature and I decided to check if a string can be found in a list of arrays so i did this:
However the output message is always "'I found no match", even when there is a match. Any help with why it's not working? Thank you
- Code: Select all
<cms:set test_var='nanowines@gmail.com' scope='global'/>
<cms:capture into="test_array" is_json='1'>
{
<cms:pages masterpage="users/index.php">
"<cms:show k_page_name />" : "<cms:show k_page_title />" <cms:if "<cms:not k_paginated_bottom />" >,</cms:if>
</cms:pages>
}</cms:capture>
<cms:each test_array >
<cms:if item eq test_var>
<cms:set msg='I found a match' scope='global' />
<cms:else />
<cms:set msg='I found no match' scope='global' />
</cms:if>
</cms:each>
<cms:show msg />
However the output message is always "'I found no match", even when there is a match. Any help with why it's not working? Thank you