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 / Help With Expense App
Power Apps
Unanswered

Help With Expense App

(0) ShareShare
ReportReport
Posted on by 14

Hello All,

I have built an expense app for employee business trips. I have 2 sharepoint lists, Expenses & Line Items. The Line Items sharepoint list has a lookup column called ExpenseID that matches the line item to the expense. When I first built my app, I had a lookup column named 'Expense Reference' in the line items sharepoint list. This matched the line item to the expense by title. This ended up being a problem because if they entered the same title for 2 different trips, then the line items would look the same. So I switched it to lookup by id. My problem now is since I made that switch, when I go to add a new line item for an expense and press save, it no longer automatically updates the look up column. So on my screen with the expenses and line items, the line items do not show up. It was working perfectly before, and I went through the entire app and updated all my formulas once I changed the lookup column. Any thoughts? 

 

Expense Gallery Items Property: varcurrentItem

Line Items Gallery Items Property: Filter('Line Items', ExpenseID.id = varcurrentItem.ID)

 

ExpenseID Data Card Default Property: 

{
'@odata.type': "#Microsoft.Azure.Connectors.Sharepoint.SPListExpandedReference",
ID: varcurrentItem.ID,
Value: varcurrentItem.ID
}

Save Button: SubmitForm(Form1);Navigate(DetailScreen)

 

 

Screenshot 2023-10-27 at 11.06.06 AM.png
Screenshot 2023-10-27 at 11.06.00 AM.png
Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @kennedyorr 

     

    Why I think our lookup column is not updating is that you are using the wrong syntax for the ExpenseID data card default property. You need to use the following formula:

    { 
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", 
     Id: varcurrentItem.ID, 
     Value: varcurrentItem.Title 
    }

    Notice that the Value field is set to the Title of the expense, not the ID.

    This is because the lookup column expects a record with both the ID and the Value of the related item.

     

    You are using a variable (varcurrentItem) to store the selected expense item, are not updating it when you navigate to the form screen? You need to make sure that the variable is set to the correct item before you open the form. You can do this by adding a Set function to your navigation formula, for example:

    Set(varcurrentItem, Gallery1.Selected); 
    Navigate(FormScreen)

    This way, the variable will always match the selected item in the gallery.

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • kennedyorr Profile Picture
    14 on at

    hmm for some reason it is still not saving properly. It is not automatically updating the look up column.

    Screenshot 2023-10-27 at 4.03.35 PM.png

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

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard