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 / Multiple Line of text ...
Power Apps
Unanswered

Multiple Line of text patch to Sharepoint List

(0) ShareShare
ReportReport
Posted on by 29

My multi-line gallery is only submitting the first line (3 times) vice submitting 2 lines that is requested. Below are pictures for reference>

This is not a form, but text inputs. I have a drop-down box for the Vendor (which this also needs to be put into the patch function, but don't know how to do that as of yet).

purchase order.png

The below picture shows that I have two lines that I want to submit into the sharepoint list:

form in use.png

On submit, I should have two new records in my sharepoint list, but the below picture shows that only line 1 is being submitted three times:

 

test for canvas app order.png

Here is the code for the submit button:

ForAll(
Gallery2_1.AllItems,
Patch(
PurchaseOrders2023,
Defaults(PurchaseOrders2023),
{
ProjectName: TextInputTitle.Text,
PurchaseOrder: Value(TextInputPurchaseOrder.Text),
OrderDate: DatePickerOrderDate.SelectedDate,
VendorQuote: TextInputVendorQuote.Text,
ShipTo: TextInputShipTo.Text,
OrderNotes: TextInputOrderNotes.Text,
Description: TextInputDescription.Text,
PartNumber: TextInputPartNumber.Text,
UnitCost: Value(TextInputUnitCost.Text),
Quantity: Value(TextInputQuantity.Text),
Hardware: ToggleHardware.Value,
Software: ToggleSoftware.Value,
Cables: ToggleCables.Value
}
);
If(
ToggleHardware.Value,
Patch(
'HARDWARE PER PROJECTS',
Defaults('HARDWARE PER PROJECTS'),
{
ProjectName: TextInputTitle.Text,
PurchaseOrder: Value(TextInputPurchaseOrder.Text),
OrderDate: DatePickerOrderDate.SelectedDate,
VendorQuote: TextInputVendorQuote.Text,
ShipTo: TextInputShipTo.Text,
OrderNotes: TextInputOrderNotes.Text,
Description: TextInputDescription.Text,
PartNumber: TextInputPartNumber.Text,
Quantity: Value(TextInputQuantity.Text),
UnitCost: Value(TextInputUnitCost.Text)
}
)
);
If(
ToggleSoftware.Value,
Patch(
'Software Purchase Orders',
Defaults('Software Purchase Orders'),
{
'Project Name': TextInputTitle.Text,
'Purchase Order': Value(TextInputPurchaseOrder.Text),
'Order Date': DatePickerOrderDate.SelectedDate,
Description: TextInputDescription.Text,
'Part Number': TextInputPartNumber.Text
}
)
)
);
ForAll(
Gallery2_1.AllItems,
Patch(
'PO Tracking',
Defaults('PO Tracking'),
{
'Project Name': TextInputTitle.Text,
'Purchase Order': Value(TextInputPurchaseOrder.Text),
'Order Date': DatePickerOrderDate.SelectedDate,
Description: TextInputDescription.Text,
'Part Number': TextInputPartNumber.Text,
'Unit Cost': Value(TextInputUnitCost.Text),
Quantity: Value(TextInputQuantity.Text)
}
)
)

 

and here is the code for the save icon:

Patch(
DescriptionCollection,
ThisItem,
{
Description: TextDescriptioninput.Text,
Unit: textinputunit.Text,
Quantity: Value(textquantityinput.Text),
UnitCost: Value(textunitcostinput.Text),
PartNumber: textinputpartnumber.Text
}
);
Collect(
DescriptionCollection,
{
Description: "",
Unit: "EA",
PartNumber: "",
Quantity: 0,
UnitCost: 0
}
)

 

So the end result is that when submitting the canvas app, I should have 2 new records (or more depending on the order) with the different descriptions: i.e. Line 1, Line 2, etc.

 

Thank you for you help in this endeavor. I am new to this program and it is a big learning curve

 

 

Categories:
I have the same question (0)
  • Sami Ullah Profile Picture
    8 on at

    You should begin by collecting each row in a collection when the "OnSelect" button is clicked, and then proceed to pass it to the "Patch" function.

    For instance:

    Collect(
    PurchaseOrders2023_Col,
    {
    ProjectName: TextInputTitle.Text,
    PurchaseOrder: Value(TextInputPurchaseOrder.Text),
    OrderDate: DatePickerOrderDate.SelectedDate,
    VendorQuote: TextInputVendorQuote.Text,
    ShipTo: TextInputShipTo.Text,
    OrderNotes: TextInputOrderNotes.Text,
    Description: TextInputDescription.Text,
    PartNumber: TextInputPartNumber.Text,
    UnitCost: Value(TextInputUnitCost.Text),
    Quantity: Value(TextInputQuantity.Text),
    Hardware: ToggleHardware.Value,
    Software: ToggleSoftware.Value,
    Cables: ToggleCables.Value
    }
    );

    Patch(
    PurchaseOrders2023,
    PurchaseOrders2023_Col
    );




  • ChButler Profile Picture
    29 on at

    Would that be OnSelect for the gallery?

  • Sami Ullah Profile Picture
    8 on at

    Yes, Save Icon OnSelect.

     

    form in use.png
  • ChButler Profile Picture
    29 on at

    It provided an issue.Issue.png

    Also another issue:
    Invalid argument type (Table). Expecting a Record value instead.

     

    &

    Issue

    Cannot use a non-record value in this context: 'PurchaseOrders2023_Col'.

     

  • Sami Ullah Profile Picture
    8 on at

    Share all code

  • ChButler Profile Picture
    29 on at

    SUBMIT BUTTON:

    ForAll(
    Gallery2_1.AllItems,
    Patch(
    PurchaseOrders2023,
    Defaults(PurchaseOrders2023),
    {
    ProjectName: TextInputTitle.Text,
    PurchaseOrder: Value(TextInputPurchaseOrder.Text),
    OrderDate: DatePickerOrderDate.SelectedDate,
    VendorQuote: TextInputVendorQuote.Text,
    ShipTo: TextInputShipTo.Text,
    OrderNotes: TextInputOrderNotes.Text,
    Description: TextInputDescription.Text,
    PartNumber: TextInputPartNumber.Text,
    UnitCost: Value(TextInputUnitCost.Text),
    Quantity: Value(TextInputQuantity.Text),
    Hardware: ToggleHardware.Value,
    Software: ToggleSoftware.Value,
    Cables: ToggleCables.Value
    }
    );
    If(
    ToggleHardware.Value,
    Patch(
    'HARDWARE PER PROJECTS',
    Defaults('HARDWARE PER PROJECTS'),
    {
    ProjectName: TextInputTitle.Text,
    PurchaseOrder: Value(TextInputPurchaseOrder.Text),
    OrderDate: DatePickerOrderDate.SelectedDate,
    VendorQuote: TextInputVendorQuote.Text,
    ShipTo: TextInputShipTo.Text,
    OrderNotes: TextInputOrderNotes.Text,
    Description: TextInputDescription.Text,
    PartNumber: TextInputPartNumber.Text,
    Quantity: Value(TextInputQuantity.Text),
    UnitCost: Value(TextInputUnitCost.Text)
    }
    )
    );
    If(
    ToggleSoftware.Value,
    Patch(
    'Software Purchase Orders',
    Defaults('Software Purchase Orders'),
    {
    'Project Name': TextInputTitle.Text,
    'Purchase Order': Value(TextInputPurchaseOrder.Text),
    'Order Date': DatePickerOrderDate.SelectedDate,
    Description: TextInputDescription.Text,
    'Part Number': TextInputPartNumber.Text
    }
    )
    )
    );
    ForAll(
    Gallery2_1.AllItems,
    Patch(
    'PO Tracking',
    Defaults('PO Tracking'),
    {
    'Project Name': TextInputTitle.Text,
    'Purchase Order': Value(TextInputPurchaseOrder.Text),
    'Order Date': DatePickerOrderDate.SelectedDate,
    Description: TextInputDescription.Text,
    'Part Number': TextInputPartNumber.Text,
    'Unit Cost': Value(TextInputUnitCost.Text),
    Quantity: Value(TextInputQuantity.Text)
    }
    )
    )

     

    I do have a collection 'DescriptionCollection' (cannot find where it was put) but here is the syntax:

    Patch(
    DescriptionCollection,
    ThisItem,
    {
    Description: TextDescriptioninput.Text,
    Unit: textinputunit.Text,
    Quantity: Value(textquantityinput.Text),
    UnitCost: Value(textunitcostinput.Text),
    PartNumber: textinputpartnumber.Text
    }
    );
    Collect(
    DescriptionCollection,
    {
    Description: "",
    Unit: "EA",
    PartNumber: "",
    Quantity: 0,
    UnitCost: 0
    }
    )

     

    and the save icon:

    Collect(
    PurchaseOrders2023_Col,
    {
    ProjectName: TextInputTitle.Text,
    PurchaseOrder: Value(TextInputPurchaseOrder.Text),
    OrderDate: DatePickerOrderDate.SelectedDate,
    VendorQuote: TextInputVendorQuote.Text,
    ShipTo: TextInputShipTo.Text,
    OrderNotes: TextInputOrderNotes.Text,
    Description: TextInputDescription.Text,
    PartNumber: TextInputPartNumber.Text,
    UnitCost: Value(TextInputUnitCost.Text),
    Quantity: Value(TextInputQuantity.Text),
    Hardware: ToggleHardware.Value,
    Software: ToggleSoftware.Value,
    Cables: ToggleCables.Value
    }
    );

    Patch(
    PurchaseOrders2023,
    PurchaseOrders2023_Col
    😞

     

     

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard