web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sending data from mult...
Power Apps
Unanswered

Sending data from multiple fields into a single column of a SharePoint list

(0) ShareShare
ReportReport
Posted on by 11

Hi all - I'm attempting to send the results of multiple fields into a single column in Sharepoint as distinct records.

 

For example, if I have 3 Commentary boxes in my form, I'd like the user to be able to send all 3 comments into a single 'Comments' column in my list. I am ok with it duplicating the other parts of the form 3 times. IE:

 

First Name     Last Name       Age       Commentary

      John             Smith            21         Comment 1

      John             Smith            21         Comment 2

      John             Smith            21         Comment 3

 

Is this possible to do? I added the other fields to the SharePoint list using the Patch function. Any help is appreciated. 

 

Thank you in advance.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    Hi @fett72 ,

    In the Update of the DataCard for 'Comment 1'

    YourComment1Box.Text & Char(10) & YourComment2Box.Text & Char(10) & YourComment3Box.Text

    If you are Patching

    Patch(
     SPList,
     . . . List reference Here . . .
     {
     'Comment 1':
     YourComment1Box.Text & Char(10) & 
     YourComment2Box.Text & Char(10) & 
     YourComment3Box.Text
     }
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • fett72 Profile Picture
    11 on at

    Hi @WarrenBelz, thank you for your quick response. The solution you provided appears to keep the 3 comments in the same record. I would like to have them separated into 3 distinct rows, apologies if that wasn't clear before. Something like:

              First Name     Last Name       Age       Commentary

    (row1)      John             Smith            21         Comment 1

    (row2)       John             Smith            21         Comment 2

    (row3)       John             Smith            21         Comment 3

     

    Is this something that can be done using the Patch function?

  • Verified answer
    WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    Hi @fett72 ,

    Try this

    ForAll(
     Table(
     {Value: YourComment1Box.Text},
     {Value: YourComment2Box.Text},
     {Value: YourComment3Box.Text}
     ) As _Comments,
     Patch(
     SPList,
     Defaults(SPList),
     {
     FirstNameField: YourFirstNameBox.Text,
     LastNameField: YourLastNameBox.Text,
     AgeField: Value(YourAgeBox.Text),
     CommentsField: _Comments.Value
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • fett72 Profile Picture
    11 on at

    Hi @WarrenBelz, that worked! Thank you so much. I just have one follow-up question, let me know if best practice is to open a new Topic:

     

    If I introduced a fifth column, say 'Topic' that corresponded to a particular 'Comment box' i.e John's Comment 1 relates to the topic of Apples:

              First Name     Last Name       Age         Topic            Commentary

    (row1)      John             Smith            21          Apples          Comment 1

    (row2)       John             Smith            21         Oranges        Comment 2

    (row3)       John             Smith            21         Pears             Comment 3


    Would that be another nested ForAll? I would just be concerned that it would generate 9 rows instead of 3. Would you have a recommendation?

  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    Hi @fett72 

    Like this I think

    ForAll(
     Table(
     {
     Value1: YourComment1Box.Text
     Value2: YourTopic1Box.Text
     },
     {
     Value1: YourComment2Box.Text
     Value2: YourTopic2Box.Text
     },
     {
     Value1: YourComment3Box.Text
     Value2: YourTopic3Box.Text
     }
     ) As _Data,
     Patch(
     SPList,
     Defaults(SPList),
     {
     FirstNameField: YourFirstNameBox.Text,
     LastNameField: YourLastNameBox.Text,
     AgeField: Value(YourAgeBox.Text),
     CommentsField: _Data.Value1,
     TopicField: _Data.Value2
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • fett72 Profile Picture
    11 on at

    That worked! Only thing I'd point out for anyone else looking at this thread is to remember to include the ',' before adding additional Values:

    Value1: YourComment1Box.Text,
    Value2: YourTopic1Box.Text

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard