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 Apps / Exporting the relation...
Power Apps
Answered

Exporting the relationship type from account entity

(0) ShareShare
ReportReport
Posted on by 53

Hi,

 

I'm trying to export information from the account entity to an on premise database. So far, it exports fine. But I'm having some problems with obtaining the relationship Type Value.

 

When I pick which fields to export, I have 2 options for "Relationship Types" in the dynamic contents section. But neither appears to give me the value of the relationship. For example, I have types like "End User", but when I had a look at what's exported, I either get a number like "6" or some code like "100000001". I was wondering how do I get the actual value of the relationship?

 

Jason

Categories:
  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at

    That is the integer value of the option set. You're describing the label/text value of the option set.

     

    Option Sets are value-pairings in CDS. This allows you to swap the labels, but maintain the underlying integer value. This integer value can vary. Numbers like 1,2,3 are usually set by MSFT in system fields (or manually by customers/ISVs). Otherwise, the integer value will be set to the publisher's option set value prefix. It will count up from ending in 0, incrementally, as the values are added to the option set.

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/types-of-fields#types-of-fields

    https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/change-solution-publisher-prefix

     

    When exporting entities, you will usually want to use the integer value to avoid having to text match. However, this isn't always the case. CDS, especially using the API, will provide both values.

    Your fields would be:

    • customertypecode (int)
    • customertypecodename (label)
  • Jason Yeung Profile Picture
    53 on at

    Hi @GarethPrisk ,

     

    Thanks for your help. When I went to the dynamics content section, I didn't see a customertypecode / customertypecodename to choose from.

     

    I searched around and found the following link:

    https://linnzawwin.blogspot.com/2020/07/get-lookup-display-name-and-option-set.html

     

    It was for the statuscode, but I gather it could be similar for relationshipcode. So I tried plugging in the following to export:

    items('Apply_to_each')?['new_relationshiptype@OData.Community.Display.V1.FormattedValue']

     

    This worked out for me.

     

    Sincerely,

     

    Jason

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard