web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Look up and add values...
Power Apps
Answered

Look up and add values from Sharepoint excel

(0) ShareShare
ReportReport
Posted on by 8

I have a power app that connects to two tables in a SharePoint excel sheet. I have a canvas app which has two drop down lists, one drop down for each table. Depending what the user selects in the drop down a numeric value will be assigned to the answer (second row (named value) in each table). I am trying to get the resulting values from the answers in the drop downs and add them together and showing it in a text box or label (or something similiar) in the same screen.

 

In an excel spread sheet I used a Vlookup function to get the values, then had a cell that added the values which worked perfectly. Any way I can do this in power apps? 

 

Thanks

Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

     

    For the Text property of your Label:

     

     

    //pseudocode
    DataCard1.Value + DataCard2.Value

     

    or

     

    //pseudocode
    Value(DataCard1.Value) + Value(DataCard2.Value)

     

    If you don't already have a Form, try this

     

    //pseudocode
    Value(DropDown1.Value) + Value(DropDown2.Value)
  • Bolmony Profile Picture
    8 on at

    Sorry I am very new to powerapps and I dont think I am explaining very well. I have included a screen shot of the two tables I am refering to. In the drop down boxes they are selecting the text such as "Software upgrade" or "Yes" which has a corresponding value (the "Result" row). Since they are not actually selecting the value I need (just the text) I need to get the value of their selection and add them together, and put that value in a lable. The names of the dropdown boxes are DropdownFirewall, and DropdownCritical. is there a better way of doing this? 

  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Bolmony 

     

    Use this for Text property of Label:

    //pseudocode
    With
    (
     {
     fwr:LookUp(YourFirewallTable,Firewall = DropdownFirewall.Selected.Value).Result
     ,crr:LookUp(YourCriticaltable,Critical = DropdownCritical.Selected.Value).Result
     }
     ,fwr & " - " & crr
    )

     

    Check if it helps @Bolmony 

  • Bolmony Profile Picture
    8 on at

    You got me 90% there. I had to tweak your code a bit to make it work. The resulting code below seems to work. Still have some testing and addtioinal tables and fields to add, but it looks good. Thanks for the help. 

     

    With

    (
    {
    fwr:LookUp(FWRouter, Firewall = DropdownFirewall.SelectedText.Value,Result),
    crr:LookUp(MissionCritical, Critical = DropdownCritical.SelectedText.Value,Result)
    }
    ,fwr + crr
    )

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Bolmony 

     

    Glad it helped.

     

    There is no way I would have known the data sources were called FWRouter and MissionCritical respectively.

    This is why I put the comment labeled psuedocode

    You are right though, since they were both numbers, the correct operator would be plus (+) and not &.

    Since I did not test that specific code in my own Canvas App, with a fully set up mock data source for Excel, that's why I also labeled it pseudocode.

    From the attachments you provided though, I could have assumed they were numbers, and provided the correct operator, I'll make a note of that.

    Glad it helped @Bolmony 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard