I am working on creating a comment history and having trouble fine tuning a couple items.
1) How do I get the last comment to show on top? Right now new entries go to the bottom
2) If the textinput filed is blank to not record and entry.
Scheduler Comment Card has this for the Update value.
ThisItem.'Scheduler Comment History'&Char(13)&TextInput1.Text&" "&Text(Now()," "&User().FullName&" "& ShortDateTime)&Char(13)
The first text field is a inserted text input field called TextInput1. I am using it to capture comments to append to a SharePoint list column called Scheduler Comment. It works great but would like to fine tune it based upon the question above.
@TBitly Thanks for taking the time to write out the expression for me. Many do not take the time to do that and for those of use not good at coding it helps us.
Lots of videos on the internet showing how to apply this concept using Patch to a Gallery which is not what I was wanting to do. Here is my simple solution to a simple form.
Final Solution:
This is a Power App form created from a SharePoint List. I have a column called Scheduler Comment set to multi line plain text. This generates a Data Card in the form when created. Below I have two Text Input fields in the data card. The #2 is the default TextInput DataCardValue9 created with the card. I unlocked the card and inserted a new TextInput field (#1) that is not linked to the SharePoint List called TextInput1. I set both inputs as multi line plain text. I set #2 to View so users can't edit the data. Using #1 as the data input, when I save the form the information is stored into #2 as a history. Below is the working solution provided by @TBitly help. You can see by the time stamps that last comment is now on top. Added Char(13) to make each entry its own line.
Scheduler Comment Data Card: Update Control:
If(Not(IsBlank(TextInput1.Text)),TextInput1.Text&" -- "&User().FullName&" "&Text(Now(),ShortDateTime)&Char(13)&ThisItem.'Scheduler Comment'&Char(13),ThisItem.'Scheduler Comment')
So the textinput1 is the text input area under the Scheduler Comment, correct? And, the comment history is under textinput1 which is fetching the values from a multiline text column in SP list..correct?
If so, then I would recommend not appending the new text.. instead I would just update on patch using this formula on save/submit etc
If(
Not(IsBlank(TextInput1.Text)),
TextInput1.Text&" -- " & User().FullName & Text(Now(),ShortDateTime) & Char(13)& ThisItem.'Scheduler Comment',
ThisItem.'Scheduler Comment'
)
I hope this helped. Let me know if I did not answer the question..
Thanks
Correct. In the picture I would want the second comment to be on top. So as any comments are added they are always on top.
Hi @DLJ,
What do you mean by the last comment? Do you mean the comment you entry now?
There are two comments within the TextInput, you want the second comment to be on the top, right?
You would just place the comment in comment history box at the end of concatenation..
If(Not(IsBlank(TextInput1.Text)), "most recent text" & char(13) & "all text from history box", all text from the history box")
Update:
I cracked the blank part. Just need to figure out how to get the last comment o be on top vs below.
If(Not(IsBlank(TextInput1.Text)),ThisItem.'Scheduler Comment'&Char(13)&TextInput1.Text&" -- "&Text(Now()," "&User().FullName&" "& ShortDateTime)&Char(13))
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2