cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Gallery In Forms revisit

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



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
1 ACCEPTED SOLUTION

Accepted Solutions

@JR-BejeweledOne 

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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

15 REPLIES 15
RandyHayes
Super User III
Super User III

@JR-BejeweledOne 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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"
    }
)

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

@JR-BejeweledOne 

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).

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

GalleryInDataCard.png

 

 

CheckboxDefault.png

 

 

CheckboxError.png



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

@JR-BejeweledOne 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

@JR-BejeweledOne 

Yes, that is correct.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Now it's not saving anything.   No errors, but also selected items not being saved.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

@JR-BejeweledOne 

Let me review....back at you shortly.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (10,414)