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
Suggested Answer

SharePoint Integrated Forms - Power Apps

(2) ShareShare
ReportReport
Posted on by 8
Hi all! I am really struggling here!
 
I have a custom Canvas Power App/Form linked to a SharePoint document library ("Invoices Library") as the data source. I created, from the "Integrate/custom PowerApps" in SharePoint, a form to tag the document. On the form, I use lookup formulas to default certain tags to values stored on the SharePoint list ("Vendor"). When I select the Vendor Name on the library form, other fields, such as Method of Payment, Sensitivity, Account Number, etc. populate the form. Things to note, the library and list are on different sites. Vendors Name is MMD (managed metadata). Method of Payment, Sensitivity Label are Choice fields and Account number is a Text field. As an example, I'll use Method of Payment. This works perfectly UNLESS my user changes the value (overrides the value with a different value from the SharePoint library). The value writes (patches) back to the SharePoint list but if the user opens the form again, it defaults back to the value on the list. Therefore, if they changed it, they have to remember to change it again. I thought this had something to do with the form mode (New, Edit, View) but I've tried changing them and have had no luck. What am I doing wrong?
 
On the app:
Vendor Name
Items: Choices([@InvoicesLibrary].'Vendor Name')
 
VendorDocType:
Items: Choices([@InvoicesLibrary].'Vendor Doc Type')
Default: Parent.Defualt (which is Invoice)
 
Method of Payment
Items: Choices([@InvoicesLibrary].'Method of Payment')
DefaultSelectedItems: 
 
If(
    VendorDocType.Selected.Value = "Invoice",
    (LookUp(
        Vendor,
        'Vendor Name' = VendorName.Selected.Label,
        {Value: 'Method of Payment'}
    ))
)
 

 

Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
    Hi
     
    I think your DefaultSelectedItems property for Method of Payment should like this, do update and give it a try:
    If(
        VendorDocType.Selected.Value = "Invoice",
        LookUp(
            Vendor,
            'Vendor Name' = VendorName.Selected.Label
        ).'Method of Payment', SomeOtherValueOrBlank
    )
    Hope this helps. 
     
    Kind regards,
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
  • SV-03102141-0 Profile Picture
    8 on at
    Thank you for your reply. Unfortunately, I'm still stuck.
     
    First, I had to use { } to get the values from the SP list.
     
    Next, I tried this formula based on your reponse:

    If(
        VendorDocType.Selected.Value = "Invoice",
        LookUp(
            Vendor,
            'Vendor Name' = VendorName.Selected.Label,
            {Value: 'Method of Payment'}
        ),
        (ThisItem.'Method of Payment')
    )
     
    What I'm trying to accomplish is the following:
     
    If the user chooses, Invoice and the Vendor the user chooses matches a Vendor Name on the Vendor list in SharePoint, return the Method of Payment, else keep what the user selects when the user opens the form again. 
     
    It appears that the formula is running every time the user opens the form. I don't want it to look it up if the user changes the value to something besides the defualt.
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Try
    If(
       VendorDocType.Selected.Value = "Invoice",
       {
          Value:
          LookUp(
             Vendor,
             'Vendor Name' = VendorName.Selected.Label
          ).'Method of Payment'
       },
       ThisItem.'Method of Payment'
    )
     
  • SV-03102141-0 Profile Picture
    8 on at
    Hi WarrenBelz:
     
    Thank you for your reply. The formula you proposed brings back the default value from the Vendor List, allows the user to select a new value and patches the new value to the SharePoint list but when opening the form, reverts back to the default value from the Vendor List. I also have a message under the formula. I attached some screenshots:
     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard