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 / Howto to realize a com...
Power Apps
Answered

Howto to realize a comments history function? --> Challenges with variables

(0) ShareShare
ReportReport
Posted on by 18

Hello,

In my scenario, I want to realize a comments history function in a PowerApp form that is based on a SharePoint list.

So far, I have the fields SP_Comment and SP_CommentsHistory.

When user saves the form, the comment from SP_Comment shall be stored in SP_CommentsHistory with some further details.

You can see the current status in below picture:

2019-01-01 18_11_28-Window.png

The implemented PowerApp logic stores the information as I want it, if I only work on one item.

Let's say, that above item has the ID 1.

If I now open another item with ID 2 (without doing a page refresh before) the field SP_CommentsHistory shows the information from the item with the ID 1.

What do I have to do to make the screen working as a user would expect it?

 

Below you can insight my current configuration:

2019-01-01 19_27_06-Window.png2019-01-01 19_27_24-Window.png

DataCardValue18 ist part of SP_CommentsHistory Card


2019-01-01 19_27_56-Window.png

DataCardValue17 ist part of SP_Comment Card

 

Thanks in advance for your support!

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @sakleboe,

    Could you please share a bit more about the SP_CommentsHistory column in your SP list? Is it a Multiple line of text type column?

    Based on the formula that you provided, I think there is something wrong with it. I have made a test on my side, and don't have the issue that you mentioned, please take a try with the following workaround:

    4.JPG5.JPG6.JPG7.JPG

    Set the OnEdit property of the SharePointIntegration control to following:

    Refresh('20190102_case3'); /* Add formula here */
    Set(varComment, "");
    Set(varCommentsHistory, ""); /* Add formula here */ Set(varCommentsHistory, SharePointIntegration.Selected.SP_CommentsHistory); /* <--Modify your formula here */ EditForm(SharePointForm1)

    On your side, you should type:

    Refresh('YourSPList'); /* <-- Add formula here */
    Set(varComment, "");
    Set(varCommentsHistory, ""); /* <--Add formula here */ Set(varCommentsHistory, SharePointIntegration.Selected.SP_CommentsHistory); /* <--Modify your formula here */ EditForm(SharePointForm1)

    Set the OnSave property of the SharePointIntegration control to following:

    If(
     Not(IsBlank(DataCardValue6.Text)),
     Set(varCommentsHistory, User().FullName & "("&Now()&"): "&DataCardValue6.Text&Char(10)&varCommentsHistory),
     Set(varCommentsHistory, "")
    );
    SubmitForm(SharePointForm1)

    On your side, it is:

    If(
     Not(IsBlank(DataCardValue17.Text)),
     Set(varCommentsHistory, User().FullName & "("&Now()&"): "& DataCardValue17.Text&Char(10)& varCommentsHistory),
     Set(varCommentsHistory, "")
    );
    SubmitForm(SharePointForm1)

    Set the OnView property of the SharePointIntegration control to following:

    Refresh('YourSPList');
    Set(varCommentsHistory, SharePointIntegration.Selected.SP_CommentsHistory); ViewForm(SharePointForm1)

    Set the Default proeprty of the SP_CommentsHistory Data Card to following:

    varCommentsHistory

    Set the Default property of the SP_Comment Data Card to following:

    varComment

    Note: The SP_CommentsHistory  column is a Multiple lines of text type column, which enables "Append changes to existing text" option. The SP_Comment column is also a Multiple lines of text type column.

     

    Please check the attached GIF screenshot for more details:

     

    Best regards,

    Kris

    Test1.gif
  • sakleboe Profile Picture
    18 on at

    Hi Kris,

    Thanks a lot for your support.

    Like in your scenario the column SP_CommentsHistory is a multipleline column.

    Based on your post I could identify that I made two mistakes:

    1. In SharePointIntegration --> OnEdit my declaration was wrong.
      I changed
      Set(varCommentsHistory, DataCardValue18.Text);
      to
      Set(varCommentsHistory, SharePointIntegration.Selected.SP_CommentsHistory);
    2. I did not implemented a refresh in SharePointIntegration --> OnView/OnEdit.
      Refresh(SupportTickets);
      Due to the Refresh I do not see the comments history from former clicked list item anymore.

     

    Best regards,

     

    Sascha

     

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard