cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hiral2010
Regular Visitor

Fetch XML in Power Portal web temaplate not retireving data of choice column of conatct table

I have created one choice column named "cp_type" in the contact table and then trying to retrieve its values based on the current user.

But its not giving the value for 'Type' column.

 

{% fetchxml my_query %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="contact">
    <attribute name="fullname" />
    <attribute name="telephone1" />
    <attribute name="contactid" />
    <attribute name="cp_type" />
    <order attribute="fullname" descending="false" />
    <filter type="and">
      <condition attribute="fullname" operator="eq" value="{{user.fullname}}" />
    </filter>
  </entity>
</fetch>
{% endfetchxml %}
<h2> {{ my_query.results.entities.size }} </h2>  
{% if my_query.results.entities.size > 0 %}    
    {% for result in my_query.results.entities %} 
            <h2> {{ result.contactid }} </h2>       
            <h2> {{ result.cp_type }} </h2>      	
    {% endfor %}
{% endif %}

 

1 ACCEPTED SOLUTION

Accepted Solutions
OliverRodrigues
Super User
Super User

Hi, I think you are missing Value/Label, give it a try using:

            <h2> {{ result.cp_type.Label }} </h2>      	
            <h2> {{ result.cp_type.Value }} </h2>      	



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


 

View solution in original post

1 REPLY 1
OliverRodrigues
Super User
Super User

Hi, I think you are missing Value/Label, give it a try using:

            <h2> {{ result.cp_type.Label }} </h2>      	
            <h2> {{ result.cp_type.Value }} </h2>      	



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


 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,271)