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>
{% 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
Solved! Go to Solution.
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 %}
<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 />
Power Apps Portals Super User
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 %}
User | Count |
---|---|
16 | |
15 | |
8 | |
3 | |
1 |
User | Count |
---|---|
32 | |
25 | |
15 | |
9 | |
3 |