Hello All,
I have a request form and one of the required fields is a "Region" Combo box in which they can select more than 1 option. I am trying to Patch all the items selected.
I am currently using the code to Patch all the required fields. I understand that I am only putting "Region: RegionInput.Selected" as the code, but "SelectedItems" comes up as an error.
CURRENT CODE FOR WHOLE PATCHING (This one only shows the first item selected and not all items selected fro "Region"):
Patch('Training Requests',Defaults('Training Requests'),
{Title: "Training Requests",
TrainingPOC: User().FullName,
MicrosoftEmail: EIDText_Input.Text,
DateRequested: Text(Today(), "[$-en-US] mmmm dd, yyyy"),
TrainingDeploymentDate: DatePicker1.SelectedDate,
TrainingMaterial: TrainingMText_Input.Text,
MaterialLink: MaterialLText_Input.Text,
Process: Dropdown1.Selected,
LOB: LOBText_Input.Text,
Region: RegionInput.Selected,
ShiftSchedule: ShiftSText_Input.Text,
Comments: 'CommentBox_Confi.'.Text,
NumberOfTrainees: Value(NumbOfTrain_Input.Text)});
Anyway I can patch all the items selected in the combo box?? including a comma if that is possible.
Any help is appreciated,
Mono
Solved! Go to Solution.
Hi @Anonymous ,
Have you enabled "Allow multiple options" option for the "Region" field in your SP List?
Could you please share more details about the formula you typed within the Items property of the RegionInput ComboBox?
Based on the issue that you mentioned, I think there is something wrong with your formula. Please consider modify your formula as below:
Patch(
'Training Requests',
Defaults('Training Requests'),
{
Title: "Training Requests",
TrainingPOC: User().FullName,
MicrosoftEmail: EIDText_Input.Text,
DateRequested: Text(Today(), "[$-en-US] mmmm dd, yyyy"),
TrainingDeploymentDate: DatePicker1.SelectedDate,
TrainingMaterial: TrainingMText_Input.Text,
MaterialLink: MaterialLText_Input.Text,
Process: Dropdown1.Selected,
LOB: LOBText_Input.Text,
Region: ForAll( // Modify formula here
RegionInput.SelectedItems,
{
Value: DisplayColumn // Displaycolumn represents the column you used as display value within the RegionInput
}
),
ShiftSchedule: ShiftSText_Input.Text,
Comments: 'CommentBox_Confi.'.Text,
NumberOfTrainees: Value(NumbOfTrain_Input.Text)
}
);
Note: Please make sure you have enabled "Allow multiple selections" option for the Region Choice column in your SP List already. If not, please enable the "Allow multiple selections" option for the Region Choice column in your SP List, then refresh the SP list connection in your app manually to apply changes.
If you do not enable "Allow multiple selections" option for the Region Choice column in your SP List, you could not patch multiple options back to the Region field from your app.
Best regards,
In the field's, in OnChange property, start a collection.
Collect(arrRegion,
ForAll(
Filter(
[List Name that contains Region],
[Region Field of The List] = [DataCard that user select Region].SelectedText.Value
),
[property you want to display]
)
)
After, you will need to use the concat function in your patch.
Concat(Distinct(arrRegion, [Field]); Result & "; ")
The ";" is the delimiter.
I did this with submitform, try with patch and tell me! (:
@Anonymous Thanks for the advice! Going to try it ASAP. Quick question, in which "OnChange" will I be putting the Collect? On the "Next" button of my Request Form?
Thank You!
Okay, I am trying to Collect the items...... only one problem that I am trying to solve:
All works... except for the equal sign? I've tried a few different things so far and it's not working.
Region field is a combo box so that the User can select more than one option. I want to Patch all the options selected into my SharePoint List.
The "Region" field in my SharePoint List is a Choice column.
Hi @Anonymous ,
Have you enabled "Allow multiple options" option for the "Region" field in your SP List?
Could you please share more details about the formula you typed within the Items property of the RegionInput ComboBox?
Based on the issue that you mentioned, I think there is something wrong with your formula. Please consider modify your formula as below:
Patch(
'Training Requests',
Defaults('Training Requests'),
{
Title: "Training Requests",
TrainingPOC: User().FullName,
MicrosoftEmail: EIDText_Input.Text,
DateRequested: Text(Today(), "[$-en-US] mmmm dd, yyyy"),
TrainingDeploymentDate: DatePicker1.SelectedDate,
TrainingMaterial: TrainingMText_Input.Text,
MaterialLink: MaterialLText_Input.Text,
Process: Dropdown1.Selected,
LOB: LOBText_Input.Text,
Region: ForAll( // Modify formula here
RegionInput.SelectedItems,
{
Value: DisplayColumn // Displaycolumn represents the column you used as display value within the RegionInput
}
),
ShiftSchedule: ShiftSText_Input.Text,
Comments: 'CommentBox_Confi.'.Text,
NumberOfTrainees: Value(NumbOfTrain_Input.Text)
}
);
Note: Please make sure you have enabled "Allow multiple selections" option for the Region Choice column in your SP List already. If not, please enable the "Allow multiple selections" option for the Region Choice column in your SP List, then refresh the SP list connection in your app manually to apply changes.
If you do not enable "Allow multiple selections" option for the Region Choice column in your SP List, you could not patch multiple options back to the Region field from your app.
Best regards,
@v-xida-msft That was my problem. I did not change it to allow multiple choices. Thanks for the help!
User | Count |
---|---|
258 | |
111 | |
95 | |
48 | |
41 |