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
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
Thank you som much , its works now 😁
You can use Value() function to convert your text to number.
Ex:
Quantity:Value(totP)
I tried to do it like this to convert it to text before patch
but still, when I patch it it says does not match the expected type Number
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.
Hi, Thanks for your replay, have tried your code and still, the number field issue happens
If I changed it to a single line of text the issue disappeared so, if I am correct Concat only works on string value
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") & ", ")
}
)
I have tried to remove quantity, total price, and unit price to check the code but now it only shows duplicated records
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
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.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional