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 / New "Save" Code doesn'...
Power Apps
Unanswered

New "Save" Code doesn't do the job

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, I have a PA form inside my PBI page. Before, in that form was a Text field - "Meeting Notes" - which user can input new text, click on the "Save" icon and the update: (1) gets saved back to the SQL database; (2) gets updated instantaneously in the PBI visual (a table). Attached is the screenshot titled for the old Save code.

Today, I was asked to add another Text field - "PM Update" - which, like "Meeting Notes", user can input new text, click on "Save" and (1) and (2) happen. Attached is the screenshot for the new Save code - the red boxed area shows where the modification was done to the old Save code to include the 2nd new text field.

Unfortunately, while the old Save code performed the actions it is supposed to, i.e. (1) and (2), the new Save code doesn't.

When I tested by inputting text in the 2 text fields, only (1) completes, but (2) doesn't, i.e. the updates don't show immediately in the PBI view - I have to manually refresh the dataset in PBI service in order to get the updates to show - which is NOT the user experience I want users to have.

Does anyone have any idea why the new Save code wouldn't work in terms of refreshing the PBI instantaneously via the PowerBI Integration component? Nothing else has changed other than this slight modification of the Save formula.

 

THANK YOU

 

OLD SAVE CODE:

old Save code.png

NEW SAVE CODE:

new Save code.png

Categories:
I have the same question (0)
  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    In PowerBi remove the app and re-add it after the app has been saved and published.

     

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, I tried that and it did not work. Refreshing the visuals or refreshing the browser didn't help either. When I click on Save in the PowerApp, I do see the change inside the form (and in SQL database), just not in the PBI page/view.

    Hoping there is another solution to try. Thank you so much for helping!

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    The only time I have seen this is when there is a delay in the publish between Power Apps and PowerBi.

    Can you take a copy of your PowerBi and try loading the app in to make sure it doesn't work or hasn't cached?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, thanks for your help/reply. I am not sure what you mean by "loading the app in to make sure it doesn't work or hasn't cached". But I found this thread: https://powerusers.microsoft.com/t5/Building-Power-Apps/PowerBIntegration-Refresh-not-working/td-p/394580#M115327
    which says: "If you use PowerBIIntegration.Refresh() function (which I am), you must use a source that supports DirectQuery and the data connection must be created using DirectQuery method."
    What is strange to me is that BEFORE I added that new field to the save code, I was using the same Import mode SQL view, and it saved and published to PBI service just fine using PowerBIIntegration.Refresh(). So what is different now if I just add another field?
    Grateful for your thoughts/advice!
    Thanks.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    .

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    What issue are you still having with this??

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The new Save code (adding the extra new input text field) doesn't updated the PBI, i.e. the PowerBIIntegration.Refresh() doesn't seem to work. Same code before that worked - except adding the new input text field to the Save code. I am hearing from many to switch to DirectQuery, but want to know why with Import Data the code worked before, but now it doesn't. Thank you.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    So your old formula worked and the new formula did not!?

     

    Try the following:

    UpdateContext({locShowPopup: true});
    
    Patch(ProjectTrackerPowerApps,
     {ID: Value(First(PowerBIIntegration.Data).ProjectRackerID),
     'Meeting Notes': Notes_1.Text,
     'TFB PM Update': Notes.Text
     }
    );
    
    PowerBIIntegration.Refresh();
    
    UpdateContext({LockIcon: false, locShowPopup: false})

     

    After you use this formula, check your datasource and make sure the two columns for the record are updated as you expect.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks. There are red squiggly lines underneath the code you just shared.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Gonna need more than the fact that there was!!!  Screenshot?  

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard