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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SharePoint Integrated ...
Power Apps
Unanswered

SharePoint Integrated Power App Form-Lookup Fields

(0) ShareShare
ReportReport
Posted on by 1

Hi,

 

I need some help with my Power App. It is integrated with a SharePoint document library. I brought in a 2nd list as a datasource to look up to based on other selected values in the app. For instance, Approver 1 populates based on the Vendor chosen. User chooses Vendor, Approver 1 has a lookup to a Vendor List that stores metadata about that vendor, such as Approvers, Payment Method, etc.

 

Datacards:

Vendor Name (DataCardValue2.Selected.Label) - Combo Box; Items - Datasource-SP Site "Invoice" Doc library site column; Managed Metadata type field in SharePoint

Approver 1 (DataCardValue8.Selected) - Combo Box; Items - Datasource - SP List "Vendor" site column (also tried using the doc library site column); Person or Group type field in SharePoint.

 

Here are my ComboBox fields:

Items - Vendor List

DefaultSelectedItems - LookUp(Vendor,'Vendor Name'=DataCardValue2.Selected.Label,'Approver 1')

Update: DataCardValue8.Selected 

Default: ThisItem.'Approver #1'

 

The lookup works perfectly. It pulls the Approver's name from the Vendor lists and populates it on the form which I can save successfully to the SharePoint doc library.

 

The issue is, if I have to change the approver on the form, not use the default, and save it, it saves to the library approver tag but when I reopen the form to edit again, the selecteddefault from the SharePoint list resets and I lose the previous that I manually selected.

 

I have tried doing an IF statement, when form is new v edit. This didn't work because it appears that SharePoint Power Apps custom forms always open in edit mode. 

 

I have changed the datasource for the combo box from the library to the list. 

 

I added a defualt value. 

 

PLEASE HELP! I have watched hours of YouTube videos and read many different blogs trying each and every option but nothing is working. Thanks. 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @SunnyDVDB1 ,

    Yes you need an If() statement of some sort as the control is doing exactly what you have asked it to do. The Default value is a waste of time as it does nothing on a Combo Box. If you only want the Approver when the Form is in New Mode, you can do this

    If(
     YourFormName.Mode = FormMode.New,
     LookUp(
     Vendor,
     'Vendor Name' = DataCardValue2.Selected.Label
     ).'Approver 1',
     ThisItem.'Approver #1'
    )

    If you want the lookup if there is nothing stored in your data field

    Coalesce(
     ThisItem.'Approver #1',
     LookUp(
     Vendor,
     'Vendor Name' = DataCardValue2.Selected.Label
     ).'Approver 1'
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power 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

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard