Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

using concat to combine rows in sharepoint list

(0) ShareShare
ReportReport
Posted on by

Please Help 

 

I am trying to patch values into SharePoint list, some of these values are from the collection called colMenu

I want the collection values to be all in one row, the one now is patching the collection values based on added rows 

MarwaAlhajri_0-1718004295445.pngMarwaAlhajri_1-1718004324904.png

 

I want them all to be in one row separated by comma or whatever like this 

column Description:Test1,test2,test3

column quantity:1,1,1

Column currency,OMR, OMR, OMR and so on....

the patch function look like this 

 
ForAll(
    Gallery1_1.AllItems,
    Patch(
        'Purchase Request',
        Defaults('Purchase Request'),
        {
            'Application Date': DataCardValue3.SelectedDate,
            Title: DataCardValue10.Text,
            'Purchase Title': DataCardValue5.Text,
            Purpose: DataCardValue6.Text,
            'Type ': DataCardValue4.Selected,
            'Payment Terms': DataCardValue2.Text,
            Justification: DataCardValue1.Text,
            'Budget Status': DataCardValue7.Selected,
            'Description/Model No': TextInput1_1.Text,
            Currency: [@Dropdown2_1].Selected.Value,
            Quantity: Value(TextInput2_1.Text),
            'Unit Price': Value(TextInput3_2.Text),
            'Total Price': Value(TextInput3_3.Text)
           
        }
    )
    );

 

  • MarwaAlhajri Profile Picture
    on at
    Re: using concat to combine rows in sharepoint list

    Thank you som much , its works now 😁

  • Verified answer
    Rajkumar_M Profile Picture
    3,631 Super User 2025 Season 1 on at
    Re: using concat to combine rows in sharepoint list

    You can use Value() function to convert your text to number. 

     

    Ex:

     

    Quantity:Value(totP)

     

     

  • MarwaAlhajri Profile Picture
    on at
    Re: using concat to combine rows in sharepoint list

    I tried to do it like this to convert it to text before patch 

    MarwaAlhajri_0-1718168787577.png

    but still, when I patch it it says does not match the expected type Number 

  • Rajkumar_M Profile Picture
    3,631 Super User 2025 Season 1 on at
    Re: using concat to combine rows in sharepoint list

    The Concat function is primarily used for concatenating strings from a table. When dealing with numbers, you need to convert them to strings before concatenating them. This is why you encountered an error when trying to use Concat directly with the Quantity field, which is a number.

  • MarwaAlhajri Profile Picture
    on at
    Re: using concat to combine rows in sharepoint list

    Hi, Thanks for your replay, have tried your code and still, the number field issue happens 

     

    MarwaAlhajri_0-1718080976619.png

    If I changed it to a single line of text the issue disappeared so, if I am correct Concat only works on string value 

  • Rajkumar_M Profile Picture
    3,631 Super User 2025 Season 1 on at
    Re: using concat to combine rows in sharepoint list

    Try this formula,

     

    Patch(
    'Purchase Request',
    Defaults('Purchase Request'),
    {
    'Application Date': DataCardValue3.SelectedDate,
    Title: DataCardValue10.Text,
    'Purchase Title': DataCardValue5.Text,
    Purpose: DataCardValue6.Text,
    'Type ': DataCardValue4.Selected.Value, // Assuming this is a dropdown control
    'Payment Terms': DataCardValue2.Text,
    Justification: DataCardValue1.Text,
    'Budget Status': DataCardValue7.Selected.Value, // Assuming this is a dropdown control
    'Description/Model No': Concat(colMenu, Description & ", "),
    Currency: Concat(colMenu, Currency & ", "),
    Quantity: Concat(colMenu, Text(Quantity, "[$-en-US]#") & ", "),
    'Unit Price': Concat(colMenu, Text('Unit Price', "[$-en-US]#0.00") & ", "),
    'Total Price': Concat(colMenu, Text('Total Price', "[$-en-US]#0.00") & ", ")
    }
    )
  • MarwaAlhajri Profile Picture
    on at
    Re: using concat to combine rows in sharepoint list

    I have tried to remove  quantity, total price, and unit price to check the code but now it only shows duplicated records

    MarwaAlhajri_1-1718014017717.png

    ForAll(
        Gallery1_1.AllItems,Patch(
    'Purchase Request',
    Defaults('Purchase Request'),
    {
    'Application Date': DataCardValue3.SelectedDate,
    Title: DataCardValue10.Text,
    'Purchase Title': DataCardValue5.Text,
    Purpose: DataCardValue6.Text,
    'Type ': DataCardValue4.Selected,
    'Payment Terms': DataCardValue2.Text,
    Justification: DataCardValue1.Text,
    'Budget Status': DataCardValue7.Selected,
    'Description/Model No': Concat(colMenu, TextInput1_1.Text & ", "),
    Currency: Concat(colMenu, TextInput2_1.Text & ", ")

    }
    ));

     

  • MarwaAlhajri Profile Picture
    on at
    Re: using concat to combine rows in sharepoint list

    I have used the code but I have received this error since quantity is a number field I tried to do Value(quantity) still gives error 

    MarwaAlhajri_0-1718013277807.png

     

  • Rajkumar_M Profile Picture
    3,631 Super User 2025 Season 1 on at
    Re: using concat to combine rows in sharepoint list

    Hi @MarwaAlhajri 

     

    Try this formula,

     

    Concat(col, columnName & ", ")

     

    Patch(
    'Purchase Request',
    Defaults('Purchase Request'),
    {
    'Application Date': DataCardValue3.SelectedDate,
    Title: DataCardValue10.Text,
    'Purchase Title': DataCardValue5.Text,
    Purpose: DataCardValue6.Text,
    'Type ': DataCardValue4.Selected,
    'Payment Terms': DataCardValue2.Text,
    Justification: DataCardValue1.Text,
    'Budget Status': DataCardValue7.Selected,
    'Description/Model No': Concat(colMenu, Description & ", "),
    Currency: Concat(colMenu, Currency & ", "),
    Quantity: Concat(colMenu, Quantity & ", "),
    'Unit Price': Concat(colMenu, 'Unit Price' & ", "),
    'Total Price': Concat(colMenu, 'Total Price' & ", ")
    }
    )

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard