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 / Powerapps Prepopulate ...
Power Apps
Answered

Powerapps Prepopulate form's data filed with filtered data from another SharePoint List

(0) ShareShare
ReportReport
Posted on by 118

Hello everyone,

I was trying to populate Approver's Name and Email address filter from a List (ApproverList) in to another Form (RequestForm) datacard so that when I save the request from, the data from another list save in RequestList. Such as

 

Request List: RequestList

Fileds: ID, ApproverName (txt), ApproverEmail (txt) and other fields for requestor

Form: RequestForm

 

Approver List: ApproverList

Fields: ID, ApproverName (Person), Team (Choice), Section (Choice), Type (Choice)

 

I would like to Filter the ApproverList such as, Category=Approver and Team=ICT And FO=CXB based on another datacard (DataCardValue75) on the RequestForm and prepopulate the filtered data in to the  same form's another data cards AproverName Name and ApproverEmail respectively so that the user can see the prepopulated data (approver's name and email) filed before summitting the form. I have done something but somehow the lookup function is not working properly.

 

RequestFormRequestForm

 

Flow8.JPG

 

If DataCardValue75 value is "Cox's Bazar" then select the approver whos Team="Admin" and Category="Approver" and FO="CXB",

otherwise select the approver whos Team="Admin" and Category="Approver" and FO is not ="CXB"

 

 

If(
 DataCardValue75.Selected.Value = "Cox's Bazar",
 LookUp(
 'ExitCL02-Approvers',
 Category.Value = "Approver" And Team.Value = "Admin" And FO.Value = "CXB"
 ).Name.DisplayName,
 LookUp(
 'ExitCL02-Approvers',
 Category.Value = "Approver" And Team.Value = "Admin"
 ).Name.DisplayName
)

 

 

Is there any other way that I should follow? Looking forward to your idea and solution.

Thanks

Leo

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,481 Most Valuable Professional on at

    Hi @leonardbd ,

    Assuming you have matching values for those combinations (there are none in your posted image), your issue I suspect is the second lookup could also pick up CXB if it is the first one listed. Try the below, although your posted code still should produce a result.

    With(
     {
     wApprove:
     Filter(
     'ExitCL02-Approvers',
     Category.Value = "Approver" And 
     Team.Value = "Admin"
     )
     }, 
     LookUp(
     wApprove,
     (
     DataCardValue75.Selected.Value = "Cox's Bazar" And
     FO.Value = "CXB"
     ) Or
     FO.Value <> "CXB"
     ).Name.DisplayName
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

     

     

  • leonardbd Profile Picture
    118 on at

    Hi  WarrenBelz 

    Excellent solution. This works for me just FINE 🙂

    But can you please tell me the reason of using "With" instead of "Set"? is wApprove a variable that you have defined?

  • leonardbd Profile Picture
    118 on at

    Hi Warren,

    I am running in to a glitch using the given formula lately discovered. 

    When Im defining approvers in Approver List first time, in request form the approver's name changes depending on the DataCardValu75. Such as:

    In Approver List:

    Approver: Leonard, FO: CXB

    Approver: Reward, FO BCO

    It reflects in the RequestForm. But if I change change the FO in approver list such as :

    Approver: Leonard, FO: BCO

    Approver: Reward, FO CXB

    It didn't change back and kept the old Approver name (Approver: Leonard, FO: CXB and Approver: Reward, FO BCO) in the datacard default event. Not sure why its happening. 

    Can you check your codes kindly and let me know? 

    Thanks

  • WarrenBelz Profile Picture
    154,481 Most Valuable Professional on at

    Hi @leonardbd ,

    This is a bit hard without your data to test, however the code below

    With(
     {
     wApprove:
     Filter(
     'ExitCL02-Approvers',
     Category.Value = "Approver" And 
     Team.Value = "Admin"
     )
     }, 
     LookUp(
     wApprove,
     (
     DataCardValue75.Selected.Value = "Cox's Bazar" And
     FO.Value = "CXB"
     ) Or
     FO.Value <> "CXB"
     ).Name.DisplayName
    )

    does the following

    • Extracts a list of records in 'ExitCL02-Approvers' where the Category (Choice column) equals Approver AND the Team (Choice) equals Admin. The With statement is only to manage Delegation as this filter is Delegable, but part of the bottom one is not.
    • It then takes these records and does a Lookup (which returns the first matching record) where either
      • Your Selected value in DataCardValue75 (you might consider some control naming protocols) equals Cox's Bazar AND the FO (I assume Choice) field equals CXB - you will get the approver matching that combination  OR
      • DataCardValue75 does not equal FXB in which case you will get the first approver in the top filter

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • leonardbd Profile Picture
    118 on at

    Hi Warren,

     

    Thanks for your reply and clarification. The codes are working well but somehow it doesn't refresh. I tried to trigger it using a button but same issue.

    Allow me Explain clearly:

    If in my approval list, Approver = UserA, Team = ICT, FO = CXB and Approver =UserB,  Team = ICT, FO=BCO, 

    the formula works just fine. But when Im changing the FO of both of the Uses (A and B) such as

    Approver = UserA, Team = ICT, FO = BCO and Approver =UserB,  Team = ICT, FO=CXB,

    the formula keeps the previous name which was lookedUp earlier. It doesn't update the User in DataCard. If I delete all Approver data from Approver list and re-enter them, then the formula get updated with correct data. 

    Can we use Filter formula instead? 

     

     

     

  • WarrenBelz Profile Picture
    154,481 Most Valuable Professional on at

    Hi @leonardbd ,

    That does not make a lot of sense to me as this is a simple lookup of (I assume) a static table, so why does it need to refresh ?

  • leonardbd Profile Picture
    118 on at

    HEre is the video of the request form and Approval List for your better understand.

     

    Looup-Issue.gif

  • WarrenBelz Profile Picture
    154,481 Most Valuable Professional on at

    Hi @leonardbd ,

    Make the Reset of that Text Box a Variable (I will use varReset) and then OnChange of any drop-down affecting it

    UpdateContext({varReset: false});
    UpdateContext({varReset: true})

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • leonardbd Profile Picture
    118 on at

    Hi Warren,

    I was hoping it will work, but didn't :(. I found the catch why it is not changing/updating because of Lookuop funtion stuck with first match. Here it goes like this...

     

    In the Approver list, when Im adding/modifying approver with following orders..

    Approver=Leonard, Type=Approver, Team=Admin, FO=BCO and then

    Approver=Reward, Type=Approver, Team=Admin, FO=CXB 

    the DataCard75 in the form stuck on the first match FO=BCO or other value from dropdown. But if I add/update the approver list with this order..

    Approver=Leonard, Type=Approver, Team=Admin, FO=CXB and then

    Approver=Reward, Type=Approver, Team=Admin, FO=BCO 

    the dataCard75 changes according to the dropdown value.

    What if we use Collection to collect the filtered data and then filter the collection to get specific data.. Just an idea 🙂

    I'm looking at the lookup formula to fix it, but if you have any ideas in the meantime to achieve it, kindly share. I will share if I found alternative.

    Thanks a lot

    Regards

    Leo

  • WarrenBelz Profile Picture
    154,481 Most Valuable Professional on at

    Hi @leonardbd ,

    That sounds a bit strange to me as (a bit like Excel) formula labels will update whenever any element of the formula is changed elsewhere.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard