cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PVLove
Helper III
Helper III

Repeating Gallery and Choice Columns

Hello PowerUsers!

I have an Edit Form and Gallery Repeating Table with multiple Choice columns. I'm not sure what I'm doing wrong, but one of the choice columns is not updating the SharePoint list correctly. The repeating gallery contains a choice column with code numbers that identify a group of items, a choice column with a list of all fittings and their descriptions and a choice column with the price of each item/fitting.

 

The 'AddItem' icon is outide of the Gallery and creates a Collection: Collect(invCollection,{ItemNo: Text(Last(invCollection).ItemNo + 1), CodeNos:"", AllRoundItems:"", RoundItemPrices:0, ItemLBsQTY:0, ItemCost:0, TotalItemCost:0})

 

The Gallery, PFGallery, contains the following items: CodeNos: ddCodeNos.Selected, AllRoundItems: ddAllItems.Selected, RoundItemPrices: ddFittingPrice.Selected, ItemLBsQTY: Value(txtLBsQTY.Text), ItemCost: Value(txtItemCost.Text)

 

The 'Create Invoice' button OnSelect has SubmitForm(InvoiceForm). I added a Patch to the InvoiceForm's OnSuccess. The ForAll statement creates duplicate items in SharePoint. A Patch creates the correct number of line items, but does not patch the items with a 1650-002 from the CodeNos Choice column. I hope this all makes sense. Screenshots attached.

Any assistance is so appreciated!

PLove

 

ForAll(
invCollection,
Patch(
TestInventoryRound3,
Defaults(TestInventoryRound3),
{
CodeNos: ddCodeNos.Selected,
AllRoundItems: ddAllItems.Selected,
RoundItemPrices: ddFittingPrice.Selected,
ItemLBsQTY: Value(txtLBsQTY.Text),
ItemCost: Value(txtItemCost.Text)
}
);
ResetForm(InvoiceForm);
Reset(PFGallery);
If(
IsEmpty(Errors(TestInventoryRound3)),
Notify(
"Success",
NotificationType.Success
);
Navigate(LandingScreen),
Notify(
First(Errors(TestInventoryRound3)).Message,
NotificationType.Error
)))

repeatingGal1.pngrepeatingGal3.pngrepeatingGal4.png

6 REPLIES 6
Drrickryp
Super User
Super User

@PVLove 

For the codenumber line

CodeNos: ddCodeNos.Selected.Value,

@Drrickryp ,

Thank you for the quick response.  I've tried to add 'Value' to CodeNos: ddCodeNos.Selected and receive the following error message: The type of this argument 'CodeNos' does not match the expected type 'Record.' Found type 'Text.' 

 

Patti

 

repeatingGal5.png

Drrickryp
Super User
Super User

@PVLove 

I never use choice type columns and prefer to simply limit the choices in PowerApps and save them to a single line of text type column.  I refer you to Shane Young's comprehensive video on SharePoint choice columns   https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Working-with-SharePoint-Choice-and-Mu... 

PVLove
Helper III
Helper III

@Drrickryp 

Morning.  Unfortunately, Shane's video did not resolve the issues I'm having with the Choice columns in my app.  I'll continue my quest for an answer.

Patti

Gorilla_8
Super User
Super User

  

Try:

CodeNos: ddCodeNos.Text

Or 

ddCodeNos.SelectedText.Value

@PVLove

@Gorilla_8 , Morning!

Thank you for replying.  However, the options posted did not resolve the issue.  The error was on my end.  I needed to Patch the Galleries and not the collection.

Patti

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,576)