web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Power Pages Portal - V...
Power Pages
Answered

Power Pages Portal - Virtual Tables - FetchXML Liquid code not working

(0) ShareShare
ReportReport
Posted on by 14

Hi all,

 

I am having this issue where the code below does not return anything. The logical name  dyn365bc_bssipmtpostedsalesinvoices_bssi_portal_v2_0 is a virtual table. I have attached my table permissions as well. Anyone knows what's the issue?

 

{% fetchxml PostedSalesInvoices %}
  {% assign params=request.params['Data'] | split:',' %}
  <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
    <entity name="dyn365bc_bssipmtpostedsalesinvoices_bssi_portal_v2_0">
      <attribute name="dyn365bc_closed" />
      <attribute name="dyn365bc_currencycode" />
      <attribute name="dyn365bc_no" />
      <attribute name="dyn365bc_postingdate" />
      <attribute name="dyn365bc_duedate" />
      <attribute name="dyn365bc_totalamountincludingtax" />
      <attribute name="dyn365bc_remainingamount" />
      <attribute name="dyn365bc_customernumber" />
      <attribute name="dyn365bc_paymentstatus" />
      <attribute name="dyn365bc_discountdate" />
      <attribute name="dyn365bc_discountamount" />
      <attribute name="dyn365bc_shortcutdimension1code" />
        <filter type="or">
          {% for param in params %}
            <condition attribute="dyn365bc_customernumber" operator="eq" value="{{param}}" />
          {% endfor %}
        </filter>
    </entity>
  </fetch>
{% endfetchxml %}
{% if PostedSalesInvoices.results.entities.size > 0 %}
{% assign resultJson = PostedSalesInvoices.results.entities %}    
{% endif %}
{% for res in resultJson %}
  {% assign invoiceCurrency = res.dyn365bc_currencycode %}
  <script>
    alert('jsonArr');
    jsonArr.push({
      Customer_No: '{{res.dyn365bc_customernumber}}',
      Currency_Code: '{{res.dyn365bc_currencycode}}',
      Document_No: '{{res.dyn365bc_no}}',
      Closed: '{{res.dyn365bc_closed}}',
      Remaining_Amount: '{{res.dyn365bc_remainingamount | decimals: 2}}',
      Posting_Date: '{{res.dyn365bc_postingdate | date: "yyyy-MM-dd" }}',
      Due_Date: '{{res.dyn365bc_duedate | date: "yyyy-MM-dd" }}',
      Original_Amount: '{{res.dyn365bc_totalamountincludingtax | decimals: 2}}',
      Payment_Status: '{{res.dyn365bc_paymentstatus}}',
      Pmt_Discount_Date: '{{res.dyn365bc_discountdate | date: "yyyy-MM-dd" }}',
      DimensiodeCode: '{{res.dyn365bc_shortcutdimension1code}}'
    });
  </script>
{% endfor %}
 
Thanks!
Table Permission.PNG
Categories:
I have the same question (0)
  • Verified answer
    GWham1 Profile Picture
    on at

    I'd do a couple checks initially.

     

    1. Does your query work in advanced find if you perform it manually or remove the filter?

    {% fetchxml PostedSalesInvoices %}
     <fetch>
     <entity name="dyn365bc_bssipmtpostedsalesinvoices_bssi_portal_v2_0">
     <attribute name="dyn365bc_closed" />
     <attribute name="dyn365bc_currencycode" />
     <attribute name="dyn365bc_no" />
     <attribute name="dyn365bc_postingdate" />
     <attribute name="dyn365bc_duedate" />
     <attribute name="dyn365bc_totalamountincludingtax" />
     <attribute name="dyn365bc_remainingamount" />
     <attribute name="dyn365bc_customernumber" />
     <attribute name="dyn365bc_paymentstatus" />
     <attribute name="dyn365bc_discountdate" />
     <attribute name="dyn365bc_discountamount" />
     <attribute name="dyn365bc_shortcutdimension1code" />
     </entity>
     </fetch>
    {% endfetchxml %}
    PostedSalesInvoices Size: {{ PostedSalesInvoices.results.entities.size }}

     

    2. Do your params appear as you are expecting?

     

    {% assign params=request.params['Data'] | split:',' %}
    {% for param in params %}
     Param: {{param}}
    {% endfor %}

     

     

    3. Have you checked the size of PostedSalesInvoices

     

    PostedSalesInvoices Size: {{ PostedSalesInvoices.results.entities.size }}

     

     

    4. Are you definitely logged in as someone who is assigned one of the roles you selected?

     

    {% for role in user.roles %}
     Role: {{role}}
    {% endfor %}

     

     

    5. I'd swap this around a little to check that you have a result before looping.

     

    {% if PostedSalesInvoices.results.entities.size > 0 %}
    {% for res in PostedSalesInvoices.results.entities %}
     Looping!
     <script>
     jsonArr.push({
     Customer_No: '{{res.dyn365bc_customernumber}}',
     Currency_Code: '{{res.dyn365bc_currencycode}}',
     Document_No: '{{res.dyn365bc_no}}',
     Closed: '{{res.dyn365bc_closed}}',
     Remaining_Amount: '{{res.dyn365bc_remainingamount | decimals: 2}}',
     Posting_Date: '{{res.dyn365bc_postingdate | date: "yyyy-MM-dd" }}',
     Due_Date: '{{res.dyn365bc_duedate | date: "yyyy-MM-dd" }}',
     Original_Amount: '{{res.dyn365bc_totalamountincludingtax | decimals: 2}}',
     Payment_Status: '{{res.dyn365bc_paymentstatus}}',
     Pmt_Discount_Date: '{{res.dyn365bc_discountdate | date: "yyyy-MM-dd" }}',
     DimensiodeCode: '{{res.dyn365bc_shortcutdimension1code}}'
     });
     </script>
    {% endfor %}
    {% endif %}

     

  • amandeep Profile Picture
    14 on at

    Hi GWham1,

     

    Solved this by trying your first and second solution. The issue was the params that is empty.

     

    Thank you!!

     

  • GWham1 Profile Picture
    on at

    Glad i could help 😁

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 61

#2
Valantis Profile Picture

Valantis 46

#2
11manish Profile Picture

11manish 46

Last 30 days Overall leaderboard