Title: <abbr title="Not Safe For Work / Mature content">[NSFW]</abbr> Filter entity
Last modified: August 20, 2020

---

# [NSFW] Filter entity

 *  Resolved [danyelconstantin231](https://wordpress.org/support/users/danyelconstantin231/)
 * (@danyelconstantin231)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/filter-entity/)
 * If i want to filter all the drop down from the contact entity. Basicly to have
   the some dropdown from crm in wordpress.
 * What will be the code ?
    IS there a option or an parameter that i forget to put
   to view all the sistem views ?
 * {% view entity=”contact” name=”Active Contacts” parameters=[ “contoso.com” ] 
   lookups={ “parentcustomerid”: params.account } count=”10″ cache=”PT30M” %}{% 
   endview %}

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [alexacrm](https://wordpress.org/support/users/alexacrm/)
 * (@alexacrm)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/filter-entity/#post-13290408)
 * [@danyelconstantin231](https://wordpress.org/support/users/danyelconstantin231/)
 * I’m not sure I understand what are you trying to do. Do you want a dropdown on
   a page that contains data from CRM? You can build one easily with [twig code](https://docs.alexacrm.com/wpcrm/twig/)
   where you can use either view or fetchxml to retrieve the data. Then loop over
   the results and build your control.
 * > to view all the sistem views
 * Again, I’m not sure what are you trying to build, the dropdown with the contacts
   or dropdown that contains the list of system views for the contact entity.
 * HTH
    George
 *  Thread Starter [danyelconstantin231](https://wordpress.org/support/users/danyelconstantin231/)
 * (@danyelconstantin231)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/filter-entity/#post-13291760)
 * > ’m not sure I understand what are you trying to do. Do you want a dropdown 
   > on a page that contains data from CRM? You can build one easily with twig code
   > where you can use either view or fetchxml to retrieve the data. Then loop over
   > the results and build your control.
 * Can you give a simple exemple, a simple code ?
 * > Again, I’m not sure what are you trying to build, the dropdown with the contacts
   > or dropdown that contains the list of system views for the contact entity.
 * I want to show a dropdown that contains the list of system views for the contact
   entity.
    Can you give a simple exemple ?
 *  Plugin Author [alexacrm](https://wordpress.org/support/users/alexacrm/)
 * (@alexacrm)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/filter-entity/#post-13292144)
 * Building dropdown from a view:
 *     ```
       [msdyncrm_twig]
       {% view entity="product" name="Web Product list" cache="PT2H" %}
       <select>
         {% for recordId, record in entityview.rows %}
            <option value="{{record['productid'].value}}">{{record['name'].value}}</option>
         {% endfor %}
       </select>
       {% endview %}
       [/msdyncrm_twig]
       ```
   
 * Retrieving all system views for an entity can be done with fetchxml using [savedquery entity](https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/reference/entities/savedquery):
 *     ```
       <fetch>
         <entity name="savedquery" >
           <attribute name="name" />
           <filter>
             <condition attribute="returnedtypecode" operator="eq" value="2" />
           </filter>
         </entity>
       </fetch>
       ```
   
 * HTH
    George
 *  Thread Starter [danyelconstantin231](https://wordpress.org/support/users/danyelconstantin231/)
 * (@danyelconstantin231)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/filter-entity/#post-13292274)
 * This is for the products list but if i need to show all the system views from
   the entity “contact” in a drop down list will be like this:
 * > <fetch>
   >  <entity name=”contact” > <attribute name=”name” /> <filter> <condition
   > attribute=”returnedtypecode” operator=”eq” value=”2″ /> </filter> </entity>
   > </fetch>
 * where “contact” is the entity ?
 * and then to be in a drop down i have to put this:
 * > [msdyncrm_twig]
   >  {% view entity=”contact” name=”contact” cache=”PT2H” %} <select
   > > {% for recordId, record in entityview.rows %} <option value=”{{record[‘productid’].
   > value}}”>{{record[‘name’].value}}</option> {% endfor %} </select> {% endview%}[/
   > msdyncrm_twig]

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[NSFW] Filter entity’ is closed to new replies.

 * ![](https://ps.w.org/integration-dynamics/assets/icon-256x256.png?rev=1589904)
 * [Dynamics 365 Integration](https://wordpress.org/plugins/integration-dynamics/)
 * [Support Threads](https://wordpress.org/support/plugin/integration-dynamics/)
 * [Active Topics](https://wordpress.org/support/plugin/integration-dynamics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/integration-dynamics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/integration-dynamics/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [danyelconstantin231](https://wordpress.org/support/users/danyelconstantin231/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/filter-entity/#post-13292274)
 * Status: resolved