Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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'}
    ))
)
 

 

  • SV-03102141-0 Profile Picture
    8 on at
    SharePoint Integrated Forms - Power Apps
    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:
     
  • WarrenBelz Profile Picture
    146,618 Most Valuable Professional on at
    SharePoint Integrated Forms - Power Apps
    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
    SharePoint Integrated Forms - Power Apps
    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.
  • Suggested answer
    Nandit Profile Picture
    1,563 Super User 2025 Season 1 on at
    SharePoint Integrated Forms - Power Apps
    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!

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard