cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

by liquid code, using fetchxml not able to retrieve entity records.

Hi Team,

Am using fetchxml to retrieve entity records.
However only 1st place attribute value is retrieving and filter condition is not working.
Getting all records of 1st attributes.

Requirement is :
Need to get the "Tax Rate" of "State" name

Below is my code:

{% fetchxml state_query %}

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">

  <entity name="test_statetaxrates">

    <attribute name="test_taxrate">

    <attribute name="test_statetaxratesid">

    <attribute name="test_name">

    <attribute name="createdon">

    <order attribute="test_name" descending="false">

      <filter type="and">

        <condition attribute="test_name" operator="eq" value="{{user.test_state.name}}"></condition>

      </filter>

    </order>

  </entity>

</fetch>

{% endfetchxml %}



{% for result in state_query.results.entities %}

   {{ result.test_taxrate }}

{% endfor %}

Getting result as all values of Tax Rates
Request you to provide your suggestions / Solution here.

Thanks,
Vaibhav



1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

By changing the sequence and removing order tag i got the resolution.
Below is executable fetchxml:

{% fetchxml state_query %}

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" enable_entity_permissions="true">

  <entity name="test_statetaxrates">

      <filter type="and">

        <condition attribute="test_name" operator="eq" value="{{user.test_state.name}}"></condition>

      </filter>

    <attribute name="test_taxrate"></attribute>

  </entity>

</fetch>

{% endfetchxml %}

View solution in original post

3 REPLIES 3
Helper II
Helper II

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">

  <entity name="test_statetaxrates">

    <attribute name="test_taxrate"/>

    <attribute name="test_statetaxratesid"/>

    <attribute name="test_name"/>

    <attribute name="createdon"/>

    <order attribute="test_name" descending="false">

      <filter type="and">

        <condition attribute="test_name" operator="eq" value="{{user.test_state.name}}"></condition>

      </filter>

    </order>

  </entity>

</fetch>

give it a try on @eliz_talent suggested fetch

 

basically the idea is to properly close the attribute tags />




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Hello,

By changing the sequence and removing order tag i got the resolution.
Below is executable fetchxml:

{% fetchxml state_query %}

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" enable_entity_permissions="true">

  <entity name="test_statetaxrates">

      <filter type="and">

        <condition attribute="test_name" operator="eq" value="{{user.test_state.name}}"></condition>

      </filter>

    <attribute name="test_taxrate"></attribute>

  </entity>

</fetch>

{% endfetchxml %}

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (99,902)