Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

PCF Lookup record Question

(0) ShareShare
ReportReport
Posted on by 32

I have a question from pcf.
I want to get other records from dataset except for the name of the table associated with the lookup record. What should I do?

 

 

I can get only name from record

const subLookup = <ComponentFramework.LookupValue>(record.getValue(this._subLookUpStr));
  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: PCF Lookup record Question

    Sure, @nanenchanga  🙂 Take your time and try things out.

    You can have a look to the Network Protocol in the Browser devtools, while the PCF is running. There you'll see the request which get generated, and you'll easily figure out what you need to change in dataset linking, to make it work.

    Love Korean 😊
    Sure, fell free to translate. Just please don't forget to mention the source. 

    Hope this helps! 

  • nanenchanga Profile Picture
    32 on at
    Re: PCF Lookup record Question

    Thank you so much for your help.

    I solved it using the other method you suggested, 'Multiple-Datasets with Link'.

    However, I still don't understand how to use linking.
    It doesn't seem to work well even if you add a value with hard coding.

    Can I try a few more days and ask you again if it doesn't work?

    And I think your blog will help me a lot. Can I translate the contents of blogs and git hubs into Korean and share them on my blog or something?

  • Verified answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: PCF Lookup record Question

    Hi @nanenchanga 

     

    Just in case it applies to your use case: if you don't need a generic PCF, there is another solution: you just extend the view where the PCF is called. Because in the views you can add columns from a linked table, as long it's a many-to-one relationship.

    Now back to the programmatic approach:
    You could try first with hardcoded names. Just to get an understanding,

    From the screenshots above, I didn't git the name of your main table (the one you apply the PCF on). So from I've got there would be

    //<NAME> would be the name of yozr main tabbe
    context.parameters.dataset.linking.addLinkedEntity({
     name: "<NAME>",
     from "<NAME>id",
     to: "cr072_sublookup",
     linking: "innner",
     alias: "ParentRelation"
    });

     This one adds only the relationship. Then you need to add the column (also in init)

    (dataset as any).addColumn("cr072_subname", "ParentRelationship");

    So when you get the data, you can access the column

    dataset.records[...].getValue("ParentRelationship.cr072_subname")

     I have a section about addColumn also in my blog (https://dianabirkelbach.wordpress.com/2022/06/12/pcf-dataset-relationships-linking-in-model-driven-apps/)

     

    Hope it helps!

  • nanenchanga Profile Picture
    32 on at
    Re: PCF Lookup record Question

    Hello.
    I tried to connect to Dataset using your example source code, but it didn't work properly.
    Please check which property should be put in.

    brasov2de/DatasetExample at 2_simpledataset-extended-relationship (github.com)

     

    The following table views exist and you want to get a specific value for the associated table in 'SubLookUp'.

    nanenchanga_1-1681715317241.png

     

     

    The following table exists and the name is 'cr072_onlynamable'

    I want to extract 'cr072_subname' from here.
    image.png

    And I set the PCF's Properties as follows.

    nanenchanga_0-1681715002109.png

    But I can't any data in view

    What is the wrong setting?

    ----------------------------------------------------------------------

    And it's a problem with modifying my code, not an example.

    And in my source code, I added the following code within the init method

    I don't know how to extract the desired value afterwards.

    image.png

     

     

  • nanenchanga Profile Picture
    32 on at
    Re: PCF Lookup record Question

    Thank you for your help.
    I wanted to get the values of the linked table as you thought.
    I will make it referring to your blog and let you know if I have any questions.

  • Verified answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: PCF Lookup record Question

    Hi @nanenchanga , 

    Let me check if I understood the question.
    You have a dataset, and want to get the table name for a lookup?
    Using the getValue() on a lookup you get the etn, id and the name

    DianaBirkelbach_0-1681468021463.png

    Maybe you want to get also more columns from the table pointed out by the lookup.
    In that case you can use the dataset "linking": https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/linking?WT.mc_id=BA-MVP-5004107

    For the linked tables, you can add columns using "addColumn": https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/dataset/addcolumn?WT.mc_id=BA-MVP-5004107

     

    I've wrote a blog about all kind of linking with dataset here. Maybe it helps you further: https://dianabirkelbach.wordpress.com/2022/06/12/pcf-dataset-relationships-linking-in-model-driven-apps/

     

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 55 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 42 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 31 Super User 2025 Season 1

Overall leaderboard