I am working on a customized SharePoint form. The customer requirement is for checkboxes rather than a combobox for the multi-select choice columns. It would be much easier if I could just do a custom app, but they use the SharePoint alert feature heavily and need the ability to go to the app right from the Alert, so a custom form is the only solution here.
So, you have the Eureka moment when you think you have figured out the solution to your problem, only to lose an engine a little while later. I didn’t completely crash, but still have an issue and can’t quite figure out what I am missing.
I have put a gallery into the form and setup the checkbox for the multi-select. The issue is while it allows me to select multiple items, it’s only saving the last item selected. I didn’t think I needed to do any sort of concat or concatenation to save the values since it’s a form, but I am obviously missing something. I can tell that the issue is most likely with the ChoicesDataCard1 Update property. Gallery.Selected is a record, but I think it needs a table and I am not sure how to get the selected items from the gallery into the table format that it needs.
Here is what I have:
GalleryChoices
CheckboxChoices
GalleryChoices Properties:
Items: Choices(PowerAppsData.Choices)
CheckboxChoices Properties:
OnCheck: Select(Parent)
OnSelect: ThisItem.Value
Default: If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),false,ThisItem.Value in SharePointIntegration.Selected.Choices.Value)
If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),false,ThisItem.Value in SharePointIntegration.Selected.Choices.Value)
ChoicesDataCard1 Properties
Update: GalleryChoices.Selected
Solved! Go to Solution.
Okay...I've flushed this out.
There is an issue with a Gallery in an EditForm datacard (one might call it a bug). I will put together a more exhaustive report and submit it to the team to review.
I found that when the Gallery is in the DataCard, normal operations on it seem to reflect other values that are not accurate.
So, relying on filtering the list and specifically the AllItems property of the gallery is not an option at this time.
Options are as follows:
1) Abandon Gallery concept
Challenges....what other choice would be an option?
2) Place Gallery external to EditForm and reflect the Update property of the datacard to the external Gallery
Challenges....if your EditForm scrolls, placing the Gallery can be a challenge.
3) Utilize a series of collect statements to gather the results.
Challenges...need to reset collection and base it on current record choice values. Need to implement more formulas to accomplish.
So that's what's on the table at the moment.
Consider the following formula changes:
GalleryChoices Properties:
Items: Choices(PowerAppsData.Choices)
CheckboxChoices Properties:
OnCheck: no formula needed
OnSelect: no formula needed
Default: If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),false,ThisItem.Value in Parent.Default.Value)
ChoicesDataCard1 Properties:
Default: ThisItem.Choices
Update:
ForAll(
Filter(GalleryChoices.AllItems, CheckboxChoices.Value),
{Value: Value,
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
)
All of this assumes that CheckboxChoices is the name of the CheckBox control that you have in your gallery.
I hope this is helpful for you.
I am unable to change the Default formula as suggested. The Parent.Default.Value errors and says the name doesn't exist. Default is not a choice if I type in Parent and trying to use Selected, causes an overall error.
Default: If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),false,ThisItem.Value in Parent.Default.Value).
Setting the Update Property to the below doesn't change the behavior. It is still only saving the last item selected
ForAll( Filter(GalleryChoices.AllItems, CheckboxChoices.Value), {Value: Value, '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference" } )
You had mentioned that your Gallery was in an EditForm. Is it not within a DataCard of your Edit form?
If not, then no, you will not have those choices, but then again, you will not be able to Update the datasource when you SubmitForm either (using the form).
A picture is worth a thousand words!!!
Thanks, I realized that I forgot we are in the Gallery with that formula. Couple ways to accommodate this, this one is fairly simple:
Change to the following:
Items property of your Gallery:
ForAll(Choices(PowerAppsData.Choices), {Value:Value, chk:Value in ThisItem.Choices})
Default of CheckboxChoices:
ThisItem.chk
All the rest should be fine.
So just to be sure I am doing this right, I replace this:
If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),false,ThisItem.Value in SharePointIntegration.Selected.Choices.Value)
with ThisItem.chk?
Yes, that is correct.
Now it's not saving anything. No errors, but also selected items not being saved.
Let me review....back at you shortly.
User | Count |
---|---|
183 | |
106 | |
88 | |
44 | |
43 |
User | Count |
---|---|
226 | |
108 | |
105 | |
68 | |
68 |