I've ran out of Google searches to try and fix my issue so hopefully someone here can lend a hand.
I have gallery items that are imported from a Sharepoint list, users are able to select the ones they want (like a shopping cart) and then on a "submit" button , I need the selections to update a different SharePoint List but I keep running into the Iconvertible error.
I have stripped down by function to the following to remove all the variables I can think of but still no luck.
ForAll(OrderList, Patch(HSOrders,Defaults(HSOrders),{Title:Label9}))
Where the OrderList is my only collection, HSOrders is the Sharepoint List I am trying to update, currently the only column in the list that I am trying to update is the Title column, and Label9 is just a text field that is pulled from the gallery.
Hello,
I'm currently struggling with this issue, Can't seem to figure it out.
So I've a SP list with several columns (all are text based columns) Supplier, Ordernumber, Internal Number, Article Number, Product, Quantity, Date, Recipient, Comments.
I changed my Onselect code to .Text after the Txtinput controls, and as the owner of the thread it only implemented the last item instead of all items even though there are several items in the collection. Thereafter I added the Defaults(SPList) formula so the full code is
ForAll(
NyInleverans;
Patch(
'Innleveranse Lager';
Defaults('Innleveranse Lager');
{
Leverantör: NyInleveransLeverantörTxtInput.Text;
Ordernummer: [@NyInleveransOrdernummerTxtInput].Text;
Ordermärkning: NyInleveransOrdermärkningTxtInput.Text;
Artikelnummer: NyInleveransArtikelnummerTxtInput.Text;
Produktbeskrivning: NyInleveransProduktTxtInput.Text;
Antal: NyInleveransAntalTxtInput.Text;
LeveransDatum: NyInleveransDatumTxtInput.Text;
Mottagaren: NyInleveransBeställareTxtInput.Text;
Kommentar: NyInleveransKommentarTxtInput.Text
}
)
)
But i still get the same result.
My add button's OnSelect Property is as following ;
Collect(
NyInleverans;
{
Title: NyInleveransLeverantörTxtInput.Text;
Ordernummer: NyInleveransOrdernummerTxtInput.Text;
Ordermärkning: NyInleveransOrdermärkningTxtInput.Text;
Artikelnummer: NyInleveransArtikelnummerTxtInput.Text;
Produktbeskrivning: NyInleveransProduktTxtInput.Text;
Antal: NyInleveransAntalTxtInput.Text;
LeveransDatum: NyInleveransDatumTxtInput.Text;
Mottagaren: NyInleveransBeställareTxtInput.Text;
Kommentar: NyInleveransKommentarTxtInput.Text
}
)
What Am i doing wrong?
Hello!
I had the same problem as this but i had multiple columns and I recieved the same error code in which I changed them all to (TextInput.Text) at the end as the solution suggested, then it all worked except some of the data didn't change the value but was the same as the first Item in the collection but after many attempts i realised that just a couple of the columns needed the .Text altough they all were the same type of column (Text) After that everything worked and changed accordingly!
So if someone had the same issue try using .Text on different combinations of the columns xD
Best Regards
Thanks This helps
Oh, you're a genius! 🙏
Sorry, He is the error code from Power Apps:
I have a issue along the same lines. I have refreshed the db and the other steps you outlined. But still getting the runtime issue. I am also trying to write to SP Lists. Code added.
Just confirming to @RandyHayes 's solution - it just happened to me on a fairly large Patch.
It refused to work (with this error on multiple attempts and refreshes) in Studio design after running code.
Saved and exited and worked perfectly on re-entering.
I had a feeling we would get to this part of it. I assumed you were testing out patching with your original problem, but, yes, what you have is going to do exactly what you see.
Now, I am not sure what you have in your OrderList as far as columns are concerned, but I'm going to take a guess that you have a Title, ItemNumber, SoldAs, Vendor, OrderAmount, DepartmentNumber, and OrderDate column. Again, just a guess and am assuming you are collecting records in that OrderList for each item in your "cart".
With the above assumption, then your formula should be like this:
ForAll(OrderList,
Patch(HSOrders,
Defaults(HSOrders),
{Title: Title,
ItemNumber: ItemNumber,
SoldAs: SoldAs,
Vendor: Vendor,
OrderAmount: OrderAmount,
DepartmentNumber: DepartmentNumber,
Orderee: Office365Users.MyProfile().DisplayName,
Date: OrderDate
}
)
);
As it was, your formula was referencing the individual text controls on your screen...which would be the same value for every record. You need your formula to reference the columns in your OrderList as it is above.
Try to work that into your formula and see if you get the results you are looking for.
If your OrderList does not have the information needed to complete the formula above, then perhaps we should look at how you are collecting records into that orderlist collection.
Sorry, I actually have one more issue regarding this if your able to help. While the patch function is working and the Sharepoint List is updating, it's only adding what the first item is and then duplicating it by how many items are in the collection, so if I have five different items and the first one is a pen, I'll have five pen entries on the list instead of each individual item. Here is the full formula I am using.
ForAll(OrderList, Patch(HSOrders,Defaults(HSOrders),{Title:Title2.Text,ItemNumber:Label9_1.Text, SoldAs:Subtitle2.Text, Vendor:Label9_2.Text, OrderAmount:Label9.Text,DepartmentNumber: Label9_3.Text,Orderee: Office365Users.MyProfile().DisplayName, Date:Label3.Text}));
Thanks so much! It was the .text after my label that was causing the issue. That was a barebones formula just to try to get it to work as this was my first attempt at a patch but I've entered the rest of it in and tested and everything works as inteded. Again thank you for the help!
WarrenBelz
98
Most Valuable Professional
MS.Ragavendar
60
stampcoin
48