I have a repeating table that adds the data to a collection, this collection then sends the data to a SPO list. One of these fields is a Choice field in SPO. This is my ForAll code
ForAll(
OtherIn,
If(
(A1_Amount >= 1),
(Patch(
'GA-OtherInPage',
Defaults('GA-OtherInPage'),
{
A1_Amountbeforetaxes_Clmn: A1_Amount,
'A1_GST/HSTTotalPaid_Clmn': A1_GSTHST,
'A1_PST/QSTTotalPaid_Clmn': A1_PSTQST,
'A1_Project/Fund_Clmn': A1_ID,
'A1_Project/Fundiption_Clmn': A1_Description,
//A1_AccountCode_Clmn:{Value:A1_AccountCode}
//A1_AccountCode_Clmn: A1_AccountCodeInput.Selected,
A1_Locn_Clmn: A1_Loc,
A1_Dept_Clmn: A1_Deprt,
A1_DeptProg_Clmn: A1_DeprtProgramCode,
FormID: First(
Sort(
'Master List Form',
ID,
Descending
)
).ID
}
))
)
);
the issues is around the
//A1_AccountCode_Clmn:{Value:A1_AccountCode}
//A1_AccountCode_Clmn: A1_AccountCodeInput.Selected,
all other fields get submitted correctly but this one. In SPO the column it set to accept values manually, and in Power Apps its complaining about requiring a record vs text entry. The Text value being the items in the collection. I've tried a few suggestions in from the forms but I think my code and method is a bit different from the solutions people have suggested.
Falling short of converting the SPO column to a text field and have the items pull from somewhere else, i would like to find a way to send this collection data to SPO.
Any help is appreciated.
sry answer late, it will patch success while choices items exist, patch nothing if not this choice
wouldn't that explicitly patch it to choice 2?
sorry for the delay. I wasn't getting an error, it would write data back to SPO but it would duplicate the data to the first choice.
"will write the value in the Text field A1_AccountCode in the Collection OtherIn to a new record in the Choice"
This got me thinking and I ended up changing the field type in SPO to a text field. This fixed the issue, was a little annoying to go back and change all the patches i had but it worked in the end. Thanks!
For my try is fine, that is go way to save data i think, every choice has items id.
Another good way is use choices function
@kilaj1 ,
We need to get down to basics here as the code
A1_AccountCode_Clmn: {Value: aPatch.A1_AccountCode}
will write the value in the Text field A1_AccountCode in the Collection OtherIn to a new record in the Choice Field A1_AccountCode_Clmn in the List 'GA-OtherInPage' providing: -
Firstly, are you getting any error on the code or is it simply not writing the data ?
Also can you please do what I asked before and post the column in your collection under View > Collections
The code didn't work unfortunately, this is what's in the A1_AccountCode within the Collection
The SPO library, GA-Otherin, looks like this
This is the column in SPO where the data gets patch to
Actually the choices is a object type column, so if u want to save the choice type, u need to get items' choice number n choice text, it's the right way
choice type like that:
{
choices num:
choices text:
}
Hi @kilaj1 ,
aPatch (you can call it whatever you want) is a disambiguation operator, which is probably not necessary, but I always use to make it clear that the value is coming from the Collection. If the code does not work, go to View > Collections > OtherIn (or is it GA-Otherin - please confirm) and see what is in the field A1_AccountCode
Thanks for the reply, I will try that code out, "aPatch" is that new? never tried that before.
A1_AccountCode_Clmn is a (single) Choice column in 'GA-OtherInPage'
A1_AccountCode in OtherIn is a Text field
Is any of this not true ?
A1_AccountCode_Clmn is a single choice column in a SharePoint list
A1_AccountCode, in the context of my code is from the collection GA-OtherIn
When I tried a similar code in mine I got an error, "expected type record, found type error."
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 1