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 / Difficulty displaying ...
Power Apps
Answered

Difficulty displaying additional information from a related database based on a selected ID

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am new to Power Apps and I have encountered a challenge that I need assistance with. I have two databases: Database A and Database B. In Database A, there is a gallery that displays various items, and there is a column called "LookupColumn" that is associated with the corresponding ID in Database B.

 

To provide more context, Database A contains columns such as Name, Description, and other relevant details. One of these columns, "LookupColumn," is a lookup field that references the ID column in Database B. This establishes a relationship between the records in Database A and the records in Database B.

 

The challenge I'm facing is how to retrieve and display additional information from Database B based on the selected ID in Database A's gallery. I want to display columns from Database B that are related to the selected item in the gallery. For example, when I select an item in the gallery with a specific ID, I would like to retrieve and display the corresponding information from Database B, such as columns like Column1, Column2, and Column3.

 

I have tried different approaches, including using LookUp functions and navigating to different screens, but I haven't been successful in achieving the desired result.

 

As a newcomer to Power Apps and the community, I kindly request your guidance, suggestions, and examples on the most effective approach to accomplish this task. Any assistance provided would be greatly appreciated.

 

Thank you in advance for your support and expertise!

Categories:
I have the same question (0)
  • AmeerJab Profile Picture
    370 on at

    Hello Dear,

     

    you can follow this scenario:

     

    1- in the gallery where you have its item as data source A, add a component eg..: textinput

    2- in the text input text property, set to Lookup(datasource B, ID = Thisitem.ID).the column you want to retrieve 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello Ameerjab, thanks for your answer.

    With this example I would display the information from DataSourceB in the 'Textinput' placed in the gallery that has DataSourceA.
    In the gallery of DataSorceA I would like only the ID of DataSourceB to be displayed, and I have already achieved that.


    What I'm looking for is that when I click on a certain Item in the DataSourceA gallery, I am directed to the details screen, which shows all the fields in the DataSourceA gallery, including the LookupColumnID column of DataSourceB, and the other fields from the DataSourceB list, related to the ID that is clicked.

     

    I've thought about making all the other fields in the DataSource B list as Lookup, but there are some fields that are 'Yes/No' and the SharePoint lists don't accept these fields as Lookup, from what I've seen.

     

    However, I tried your example, but I put the 'TextInput' not in the gallery that receives DataSourceA, but in the 'Details' screen form that also receives DataSourceA:

     

    On the 'Details' screen, in the 'OnSelect' property of the Form that receives the DataSourceA I put: "Navigate(DetailsScreen, ScreenTransition.Fade, { SelectedID: ThisItem.LookupColumnID })"

     

    Then, I added a 'TextInput' and in its 'Item' property I put:
    "LookUp('DataSourceB', ID = SelectedID).ColumnName".

     

    I got the error: "Incompatible types of comparison. These types can't be compared: Number, Record."

  • Verified answer
    AmeerJab Profile Picture
    370 on at

    Hello dear,

     

    i woud suggest creating two variables, one hold the data selected from datasourceA, and a second variable where you have the lookup value from datasourceB like below

     

    Set(selectedItemFromA,Thisitems);

    Set(dataFromB, lookup(datasourceB,ID = Thisitem.ID).Column);

     

    "LookUp('DataSourceB', ID = SelectedID).ColumnName". this will give you error, as selectedID is a record where you you need to select a column so it should be:

    "LookUp('DataSourceB', ID = SelectedID.ID).ColumnName".

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks very much AmeerJab, your suggestion worked.

    Thanks again.

  • AmeerJab Profile Picture
    370 on at

    Thanks dear, if you can kindly mark it as solved so others can relate to this solution.
    cheers

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard