cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Patching all contents of a combo box that have been selected

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

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, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
Highlighted
Frequent Visitor

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! (:

Highlighted
Anonymous
Not applicable

@mdeleuterio  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?

 

Region Collect_LI.jpg

 

Thank You!

Highlighted

From the field the user selects the region.
I have to change my field to combobox, dropdown doesn't work!
Highlighted
Anonymous
Not applicable

Okay, I am trying to Collect the items...... only one problem that I am trying to solve:

 

 

Region Collect Code.PNG

 

All works... except for the equal sign? I've tried a few different things so far and it's not working.

Highlighted

RegionInput is a dropdown?
RegionInput.SelectedText.Value

The field Region in your database is what kind?
Highlighted
Anonymous
Not applicable

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.

Highlighted
Anonymous
Not applicable

The "Region" field in my SharePoint List is a Choice column.

Highlighted
Community Support
Community Support

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, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Anonymous
Not applicable

@v-xida-msft  That was my problem. I did not change it to allow multiple choices. Thanks for the help!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,665)