cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GrantAstley
Frequent Visitor

display a calculated value from excel back to powerapps

Just wondering is there a way to update a table in excel and have the vba assosiated with that table be exicuted?

It looks like powerapps edits online which prevents and vba and macros from running.  Is there a way to force it to open an instance of excel or a way to trigger a vba event from power apps?

 

As background I have a table which gets written to and read from by powerapps.  The read from values need to be calulated based on the inputs in that table.  Siince powerapps wont read or write to a table with formula in it, I have a vba worksheets_change script that runs whenever 1 of the columns is updated.  This then inserts the result in the correct column ready to be read by powerapps.  However since this is not exicuted when editing via powerapps the result is not updated.

 

Is there a workaround to what I am trying to achieve (displaying a calulated value from a table in excel back to powerapps)?

6 REPLIES 6

Hi @GrantAstley,

 

Can you do the calculation in Powerapps using the data from the table and the functions in Powerapps?

Not sure on what can be calulated in powerapps to be truthfull.  

I need to be able to count the number of rows in column B that have the same value as what I am going to enter - Currently using 

=IF(B7>0,COUNTIF(B$7:B7,B7),"")

placed in column F

 

I have to be able to use vlookup as follows

=IF(ISERROR(VLOOKUP(B$7:B$1000&"_"&F$7:F$1000-1,G$7: O$1000,8,FALSE)),C$7:C$1000,VLOOKUP(B$7:B$1000&"_"&F$7:F$1000-1,G$7: O$1000,8,FALSE))

Placed in column M, not sure why but : O in the code box is showing up as an emoticon! Shouldt the code box not convert text to emoticons?  So I left a space between : and O that would not normally be there.

 

Then the rest is just addition and subtraction which I would have no problem doing.

 

Do you know if the above type calcs are possible within powerapps?  

 

Hi @GrantAstley,

I'm no expert in Excel but I think there are analogous functions in Powerapps to do what you want.  

To get the number of rows that match a value see if this works. 

Startiing with an Excel table named Table1 with columns headings, col1,col2,col3,col4,etc.  To get the number of rows in the table matching a particular value in one of the columns, say col2, put a button, a TextInput control and a label on the screen. 

Create a filtered collection of your table by putting a value in the TextInput control, set the OnSelect property of the button to ClearCollect(colTable,Filter(Table1,col2=TextInput1.Text)) . Make the Text property of the label, CountRows(colTable).  When you press the button, the label will show the number of rows in your filtered table. You can then reference this value in your formula later on using Value(Label1.Text).  This converts the Text in Label1 to a number.

 

The second formula is a bit trickier to me as I have rarely used formulas in Excel. As I understand it, Vlookup looks up a value in the first column of the specified range, and returns a value in the same row from another column.  This seems to be similar to the Lookup() function in Powerapps which will search a datasource or collection and returns the first record in a table that satisfies a formula. An optional parameter can reduce the result to a single value in that record. The syntax is LookUpTableFormula [, ReductionFormula ] ) or in the case of the example above, LookUpcolTablecol2=Textinput1.Textcol3).  The result of the lookup without the optional reduction can be displayed as a row in a Datatable control, or with the reduction, it can be displayed as a single value in a label.  I'm not sure if this helps get you on the right track but it seems to me that the required functions are present in Powerapps to accomplish your goal. 

Hi 


Yes that looks like it should work.  I will have a play around and see if I can get it to work using that approach.  The only thing I would have to check is if the lookup function can get a value from a previos row.  It will look for the value in column L on that row in cloumn G then return the value in the row that the value was found in column G in column N of that row

 

ie in the below.  The formula is is the green highlighted cell.  It looks for the value 1_2 which is in column 10 in column6 of the table and returns the value in column 12 of the table in the same row of which the value was found - orange highlighted cell.

Capture.PNG

Hi Grant,

 

Does your table contain an Index column like an ID or list of sequential numbers?

Keyvan
Frequent Visitor

@GrantAstley Hello, 
 I have the same issue and can not do the calculation in Powerapss since the calculation is complicated. 

Did you find the solution for that?

Thank you

Keyvan

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,153)