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 / Comment Box Updates
Power Apps
Answered

Comment Box Updates

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a form that updates a SharePoint list using radio button choices, but I also want to add in a text input field for comments that the user may need to put in. Currently each of the datacards are updated by the radio buttons selection, but I would also like to do one of two things:

 

1) I want to update the datacard with the comment box in addition to the radio button but I don't know how to go about that, if it is even possible.

 

2) If (1) isn't possible I want to have a single comment datacard that collects all the comments from each of the other comment boxes. I know I can do that simply by a concatenate function, but I don't want to have huge spaces between comments in the collected comment box if no comments were entered in some of the boxes. I'm not sure how to go about that so any help would be great.

 

Snips for reference:

 

nvargas_0-1616096028177.png

nvargas_1-1616096047164.png

 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Struggling to see the issue.

     

    So I can see you have the controls where comments can be captured but are we saying that when you click some kind of submit button, it is only saving the radio buttons. Are these default cards by way of directly connecting to an SP data source. If so, you would have to create a place to store said comments, so for an SP List, add additional columns. And then within your app, tell it that this control, updates those columns. Also if it is an SP list, then if you add new columns, you can just go in, refresh the data source, add in the newly added columns. You can even unlock the default cards, steal the control and paste inside an existing control if you want and that way it will already know which SP column to update.

     

    If you were saving by way of a Patch, then you have ultimate flexibility and you just add in the columns and say something like:

     

    Patch(splist,defaults(splist),{

    NewSPColumn1: txtCommentBox1.Text,
    NewSPColumn2: txtCommentBox2.Text
    })

     

    But I imagine that it is using SubmitForm?

     

    The reason I am struggling to understand the issue is that adding in text boxes alone will not do something as you need all the parts.

     

    So the control to facilitate the data input, the logic to save the change based on inputted values and finally the place to store the data.

     

    So to help more would need to know more about part 2 and 3 in this equation

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

    @nvargas 

    If you want to separate all these out but yet have them all together, here is what you do.

     

    1) Add the Comment field to your EditForm.  It does not have to be visible, but based on your image, I think you want it for the general comments.

    2) Add the TextInput controls to each datacard you want to have comments in.  Have it's text set to pull out the comment for its section.

    3) Use the Update property on the Comment field to concat the items together.

     

    So...specifics.

    Taking your picture.  I will say you have three datacards, the first I will call "FilledOut", the second I will call "AssessedAppropriate"

     

    IN your first datacard, place your TextInput control (I'll call it TextInput1) and set the Text property to:

       Last(Split(LookUp(Split(ThisItem.Comments, "||"), StartsWith(Result, "F1"), Result), "~")).Result

    Same for the second TextInput (I'll call it TextInput2), except change the F1 to F2

    For the general comments (I'll Call that TextInput3), same formula except change the F1 to F3

     

    Now, in the Update property of the datacard for the comments field, set the formula to:

     

    Concat(Table({ctrl:TextInput1, fl:"F1"}, {ctrl:TextInput2, fl:"F2"}, {ctrl:TextInput3, fl:"F3"}), fl & "~" & ctrl.Text & "||")

     

    This should give you what you are looking for.

     

    I hope this is helpful for you.

  • nvargas Profile Picture
    Microsoft Employee on at

    Currently, those comment boxes don't save anywhere with the exception of the second snip. I've only created the concatenate function so the second snips comment box gets all the comments. I'm new to the platform and I'm just not aware of how to save the data from both the radio buttons and the comment box to the specific SharePoint list column for that question.

     

    Essentially if the Radio button is selected "No" and I make a comment in the comment box saying "Risk Assessment was incomplete" what I want the SharePoint column for this item to show is "No, Risk Assessment was incomplete" when it is submitted.

     

    Though it sounds like you're saying that I would have to create new columns in the SP list for each question that populates itself with the comments rather than keeping them together in the same column.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Ignore me, I now understand what you are asking for. I misunderstood, sorry. Will leave you in the capable hands of @RandyHayes 

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

    @nvargas 

    No need to create new columns.  

    Assuming you are doing all of this in a Form, then there is nothing more you need to do other than to SubmitForm to get it working. 

    The text will all be broken out between the text inputs and the datacards for your Radio buttons will already be handled in your form for the appropriate fields.

  • nvargas Profile Picture
    Microsoft Employee on at

    Well, that's a lot to get my head wrapped around... by doing what you've suggested it will do what I previously commented about in my last reply? or will it just update the comment card column?

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

    @nvargas 

    It's fairly basic.  We are using an EditForm (confirm that is the case) and you have a datacard for all three fields you showed.

    You are unlocking the cards to change them all.  Then you are adding a TextInput to the first two datacards.  The Comment datacard will already have one.

    Then you adjust the formulas on the properties I mentioned and you are done.

    All you need to do then is SubmitForm to save the information to your datasource.

     

  • nvargas Profile Picture
    Microsoft Employee on at

    The text input doesn't have a "text" property. Do you mean the default field?

  • nvargas Profile Picture
    Microsoft Employee on at

    I have another question on this topic. I was able to get the function to work (Thank you for that), but I was wondering if the "F#" is required to be there?

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

    @nvargas 

    Sorry I never replied to your prior post - yes, the Default property was what was meant in one of the statements.

    As for the F#'s, yes, that is what distinguishes which comment the text goes to.

     

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard