<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community: Message List - Trying to use Liquid to filter a Webapp by another Webapps data</title>
    <link>https://forums.adobe.com/community/business_catalyst/developer_forum?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Wed, 05 Nov 2014 19:36:14 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2014-11-05T19:36:14Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Trying to use Liquid to filter a Webapp by another Webapps data</title>
      <link>https://forums.adobe.com/message/6902777?tstart=0#6902777</link>
      <description>&lt;!-- [DocumentBodyStart:35b3f032-f9bd-4af5-9e28-214157a27237] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Here's the scenario.&amp;nbsp; I have a customer who wants me to build a very simple task system for their employees, where the employer can assign HR related tasks to an employee.&amp;nbsp; The employee would login and see only the tasks assigned to them.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I have a Webapp "Intranet - Employee" and another Webapp "Intranet - Employee Tasks".&amp;nbsp; In the "Intranet - Employee Tasks" Webapp, I have a field with the datasource linked to the Webapp "Intranet - Employee".&amp;nbsp; I have an Secure Zone called "Intranet".&amp;nbsp; I have a page in the Secure Zone titled "Intranet - "Employee".&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;On the page "Intranet - Employee", I have the following module using Liquid:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;{module_webapps id="23727" filter="all" render="collection"}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In the "Intranet - Employee Tasks" Webapp layout, I have the following:&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="intranet-task-list-item"&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;{% for item in items %} &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="name"&amp;gt;{{item.name}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="intro"&amp;gt;{{item.['task intro']}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="type"&amp;gt;{{item.['task type']}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;{%endfor%}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This works fine.&amp;nbsp;&amp;nbsp; It shows all of the tasks, not just the ones assigned to the logged in employee. Now I want to filter by the user that's logged in.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This module call gets the Item Id I want to filter by:&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;{module_webappscustomer id="23725" filter="all" useBackupTemplate="true"}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;In the "Intranet - Employee" Webapp backup template, I have one tag: {tag_itemid}.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now, how do I filter the second Webapp "Intranet - Employee Tasks" by the Item Id.&amp;nbsp; Here's how I started, but it's not working:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;On the page "Intranet - Employee":&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;{module_webapps id="23727" filter="all" render="collection" emplid="{{module_webappscustomer id="23725" filter="all" useBackupTemplate="true"}}"}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In the "Intranet - Employee Tasks" Webapp layout, I have the following:&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="intranet-task-list-item"&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;{% for item in items %} {%if {{item.['employee_id']}} == this.params.emplid %}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="name"&amp;gt;{{item.name}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="intro"&amp;gt;{{item.['task intro']}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="type"&amp;gt;{{item.['task type']}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="employee"&amp;gt;{{item.['employee']}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="employee id"&amp;gt;{{item.['employee_id']}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;div class="testing for id"&amp;gt;testingfor: {{params.emplid}}&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;{%endif %} {%endfor%}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Is something like this possible?&amp;nbsp; I've very new to Liquid, so maybe I'm missing something big.&amp;nbsp; If I take out the if statement, I can see that the parameter gets passed to the layout.&amp;nbsp;&amp;nbsp; Also, if I pass a text variable, instead of using the module_webappscustomer ..., the if statement works.&amp;nbsp; But, I cannot get them both the work together.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Do I need to assign a variable first?&amp;nbsp; Is there a better way to link the two Webapps?&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks in advance for the help!&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:35b3f032-f9bd-4af5-9e28-214157a27237] --&gt;&lt;img src='/beacon?t=1415882008456' /&gt;</description>
      <pubDate>Wed, 05 Nov 2014 19:35:29 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6902777?tstart=0#6902777</guid>
      <dc:date>2014-11-05T19:35:29Z</dc:date>
      <clearspace:dateToText>1 week 17 hours ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

