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 Apps
Answered

Lookup column

(0) ShareShare
ReportReport
Posted on by 154

Good morning,
I work on Power apps and I use SharePoint as data source.
I have two SharePoint lists A and B respectively with the following columns:
A: Title and Perdiem (lookup column).
B: City and Perdiem.
When I create an item in list A and then if I come back to modify the Perdiem value of list B, I see that it modifies all the previous perdiem values already recorded in list A.
How can I ensure that the update of the perdiem field of B does not affect all the previous registrations of Perdiems of the list A.
Maybe I'm not using the correct relationship between A and B using a lookup column.
THANKS

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Fahd ,

     

    Can you share the code or screenshot to see how your controls are setup on the Screen?

     

    Reason is: I'm trying to understand the sequence of process and identify where is the issue.

    I feel you missed updating some field or using old records in the Form.

     

  • Fada Profile Picture
    154 on at

    Hi @Ethan_R ,

    Below two screenshots of A before and after I have updated Perdiem of B. How can I setup a control on the screen to prevent the update of the data already records.

    Thanks

     

     

    list B before I update Perdiem.JPG
    list A after I update perdiem of B.JPG
    List A before.JPG
  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Fahd ,

     

    I hope you are updating necessary List in SharePoint. 

    How are you updating records for these lists?

     

    Let's say you want edit List then you must save those items only

    //For Editing List B
    Patch(
     ListB,
     Gallery.Selected,
     {
     Perediems: Value(DataCardValue.Text)
     }
    )
    
    //For Editing List A
    Patch(
     ListA,
     Gallery.Selected,
     {
     Perediems: Value(DataCardValue.Text)
     }
    )

     

    Now if you are using same buttons then do use a variable that which is the last Gallery Record you selected:

    To make it clear, you are identifying which Gallery the record belongs thus you can use Patch accordingly

    //OnSelect Records to Gallery that has List A as datasource
    UpdateContext({varSelectedSource: "List A"});
    
    //OnSelect Records to Gallery that has List B as datasource
    UpdateContext({varSelectedSource: "List B"});
    
    //Then when you are saving record
    If(
     varSelectedSource = "List A",
     Patch(...List A...),
     Patch(...List B...)
    )

     

    Hope this helps

  • Fada Profile Picture
    154 on at

    Hi @Ethan_R , your anwsers and the below links helped me. Thank you very much.

    https://www.youtube.com/watch?v=pKHyXyR3tYo

     

    https://www.youtube.com/watch?v=BzZ0a3zRFUk

     

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard