cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Submit textinput to a commentfield in a sharepoint list with timestamp and username

Hello!

 

I was reading about append to comment and that function doesnt really work in powerapps yet, and in my case its kinda crucial. I need that function somehow.

 

Is there anyway to make a textinput in powerapps that I can make a comment inside and click "Save" and then in shows up in an simple commentcolumn I have in a sharepoint list with a timestamp and username of the person who did the comment?

 

See this picture for a reference:

powerapps händelselogg.png

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: Submit textinput to a commentfield in a sharepoint list with timestamp and username

@288088 
My preferred way to do this is by using the PATCH function and an HTML text control.

 

#1  In SharePoint, change the column type of Comment to multi-line text.  Then Refresh the datasource in PowerApps

 

#2  Put this code in the OnSelect property of your Save button

 

Patch(
    your_datasource_name,
    Defaults(your_datasource_name),
    {Comment: "<p>User().FullName&"" ""&Text(Today(),""yyyy-mm-dd""&"" - ""&TextInput1.Text</p>"
)
    

 

#3  Finally, create a new HTML Text control to display the comments and put this code in the HtmlText property.

ThisItem.Comment

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Post Patron
Post Patron

Re: Submit textinput to a commentfield in a sharepoint list with timestamp and username

Hello!

I tried this but I get an error:

An operator was expected. We expect an operator such as +, *, or & at this point in the formula.

and

 

The name is not valid. This identifier cannot be identified

 error comment.PNG

 

I really appreciate your help!

Highlighted
Super User III
Super User III

Re: Submit textinput to a commentfield in a sharepoint list with timestamp and username

@288088 
I've edited my code above.  Forgot to use double-quotes x2 inside the HTMLtext.

Highlighted
Post Patron
Post Patron

Re: Submit textinput to a commentfield in a sharepoint list with timestamp and username

Now I got no errors on the code. But when I save the comment it wont show up in the comment section. But it pops up another error on the button that says another field is requiered to be filled in, but the thing is that field is already filled in on that object i'm trying to make a comment on.. This is in a gallery wjth many object, and I want to be able to make comment on single objects in this gallery. Dont I have to use a condition like "Selected" or something? Any idées?

 

Once again, I really appreciate your help!

Highlighted
Post Patron
Post Patron

Re: Submit textinput to a commentfield in a sharepoint list with timestamp and username

Is there someone who can help me?

Highlighted
Post Patron
Post Patron

Re: Submit textinput to a commentfield in a sharepoint list with timestamp and username

Hello again! I still havent been able to solve this, is these anyone who can help me?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,472)