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 / using concat to combin...
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)
           
        }
    )
    );

 

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    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.

     

  • MarwaAlhajri Profile Picture
    on at

    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

     

  • MarwaAlhajri Profile Picture
    on at

    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 & ", ")

    }
    ));

     

  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    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

    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,747 Moderator on at

    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

    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 

  • Verified answer
    Rajkumar_M Profile Picture
    3,747 Moderator on at

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

     

    Ex:

     

    Quantity:Value(totP)

     

     

  • MarwaAlhajri Profile Picture
    on at

    Thank you som much , its works now 😁

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard