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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Exporting the relation...
Power Apps
Unanswered

Exporting the relationship type from account entity

(0) ShareShare
ReportReport
Posted on by 38

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:
I have the same question (0)
  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at
    Re: Exporting the relationship type from account entity

    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
    38 on at
    Re: Exporting the relationship type from account entity

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard