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 / Form field value based...
Power Apps
Unanswered

Form field value based on lookup list, filters another lookup field with matching value of previous field selected

(0) ShareShare
ReportReport
Posted on by 14

Good day all

 

I am fairly new to Power apps and have a simple canvas app with a gallery on the left and a form on the right. Two of the fields on the right namely (Department and Section) are lookup fields. These lookup fields is from another list, however each section has multiple lines with relevant sections. 

 

Issue1: Duplicate values displayed on drop down in form.

(I have tried the below and the list then only displays distinct departments however when I submit form the value ignores the selected department and save a blank value)

Distinct(Choices('PrimaryList'.Department), Value)​

Question: How do I ensure the value selected is save when I submit the form?

 

Issue 2:

When I select the department, I would to only display the matching sections from the lookup list in the sections field on the list.

Currently it the displays the whole list of available sections in the list.

I was thinking of using a filter but not sure how or if this is the best approach?

 

Please help me?

 

 

 

 

Screenshot 2023-06-29 134956.png
Screenshot 2023-06-29 133744.png
Categories:
I have the same question (0)
  • Zacharie_Cortes Profile Picture
    170 on at

    Have you tried : 
    ForAll(Distinct(Choices('PrimaryList'.Department), Value)​,{'PrimaryList':Value}) ?

  • Gerries Profile Picture
    14 on at

    Hi @Zacharie_Cortes 

     

    I assume this is for my Issue 1 listed?

    I just tried it, it allows me to select the distinct departments in the list but does not save when I submit form.

  • Zacharie_Cortes Profile Picture
    170 on at

    Yes it war for the first issue.

    For the second you can use a filter 

  • Gerries Profile Picture
    14 on at

    Ok thanks, but how do I get the department selected to save when I submit form?

     

    Could you please provide more details on how to setup the filter for my second issue?

  • Zacharie_Cortes Profile Picture
    170 on at

    it should save corectly now. If not, explain me more how do you save the whole thing

  • Gerries Profile Picture
    14 on at

    It doesn't save. I have a form based on a main list. Two of these column's are lookup fields to another list.

    These one columns is called "Department" and the other is called "Section"

    I have  "new" and "edit" buttons created. So when I click on new button I can add a new record, when I get to department I can select the department and I only see one record because of the distinct function but when I save (Submit form) using a save button it doesn't save the selected department value, on the list the department field is blank. If I remove the distinct function it saves but then I see the duplicates of departments because one department is linked to multiple sections. 

  • Gerries Profile Picture
    14 on at

    On department DataCardValue under Items I have this: 

     

    ForAll(Distinct(Choices([@'HR Inquiries - Tracker'].Department), Value),{'HR Inquiries - Tracker':Value})

     

    But it doesn't save, when I select a department and then submit form.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 413

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
timl Profile Picture

timl 315 Super User 2026 Season 1

Last 30 days Overall leaderboard