cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

Allowing two galleries to populate fields to edit

I have two Galleries. Both are circled in blue within the screenshot. The left one is Gallery 6 and the right one is Gallery 4. I would like both galleries to populate the fields if a submission is clicked upon with each respective gallery. Currently only the submissions within Gallery 6 populate the fields. Gallery 4 does not populate. Possibly adding both galleries to the Items code of the Form? I'll post my current code down below:

 

Items within Form2:

If(
IsBlank(VarLastItems),
Gallery6.Selected,
VarLastItems
)

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @pnass001 ,

Sure. I assume that the 'Standards Selection Form Data Collection' is your SP List, and your Edit form is also connected to it, right?

 

Set the OnSelect property of the Gallery6 to following:

Set(var, "Users");
Set(SourceGallery, "Gallery6")  // Add this formula

Set the OnSelect property of the Gallery4 to following:

Set(var,"moderator");
Set(SourceGallery, "Gallery4")  // Add this formula

 

Set the Item property of the Edit form to following:

If(
   !IsBlank(VarLastItems),
   VarLastItems,
   If(
      SourceGallery = "Gallery6",   // Check if you selected a item from your Gallery4 or Gallery6 against on the SourceGallery variable
      Gallery6.Selected,
      SourceGallery = "Gallery4",
      Gallery4.Selected
   )
)

Note: The DataSource property of the Edit form has been connected to 'Standards Selection Form Data Collection' already.

 

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

3 REPLIES 3
Community Support
Community Support

Hi @pnass001 ,

Could you please share a bit more about the formula you typed within the Items property of the Gallery4 and Gallery6?

Do you want to the two Galleries to be populated with the submission from your Edit form?

 

If you want the two Galleries to show up the submission from your Edit form, I think the two Galleries should be connected to your data source rather than the Item code of the Edit form.

 

If the data source used in your canvas app is a SP List, please set the Items property of the Gallery6 and Gallery4 to following:

 

'Your SP List'

 

 

In addition, do you want to populate the fields in your Edit form with values from any one of your two Galleries? I have made a test on my side, please try the following workaround:

Set the OnSelect property of the Gallery6 to following:

 

Set(SourceGallery, "Gallery6")

 

Set the OnSelect property of the Gallery4 to following:

 

Set(SourceGallery, "Gallery4")

 

 

Set the Item property of the Edit form to following:

 

If(
   !IsBlank(VarLastItems),
   VarLastItems,
   If(
      SourceGallery = "Gallery6",
      Gallery6.Selected,
      SourceGallery = "Gallery4",
      Gallery4.Selected
   )
)

 

Note: Please make sure the both Galleries (Gallery4 and Gallery6) are connected to same data source as your Edit form. If the both Galleries are connected to different data source, I afraid that there is no way to achieve your needs, because, one Edit form could only be connected to single one data source rather than multiple data sources.

 

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.

@v-xida-msft Yes, I would like both Galleries to be able to populate the submission in Edit form. They are also both connected to the same data source. 

Gallery 4 is the rightmost one:

 

Item for Gallery 4: I have a filter text to filter all user submission

Filter(
'Standards Selection Form Data Collection',
StartsWith(
'Standard Endorser',
FilterTextBox.Text
) ||
StartsWith(
'Department ',
FilterTextBox.Text
)
)

 

Onselect: Only me and another person are moderators so this gallery is only accessible by us

Set(var,"moderator")

 

Item for Gallery 6: Filters by user's own submissions

Filter(
'Standards Selection Form Data Collection',
'Creator Email' = varUser)

 

Onselect: accessible by unique user

Set(var,"Users")

 

 

I tried to input your code in Item for the Edit form relevance to mine and the fields changed up on me. I was hoping with this code you can give me a clearer path because I'm afraid of messing up all the progress I've made. Thank you!

Hi @pnass001 ,

Sure. I assume that the 'Standards Selection Form Data Collection' is your SP List, and your Edit form is also connected to it, right?

 

Set the OnSelect property of the Gallery6 to following:

Set(var, "Users");
Set(SourceGallery, "Gallery6")  // Add this formula

Set the OnSelect property of the Gallery4 to following:

Set(var,"moderator");
Set(SourceGallery, "Gallery4")  // Add this formula

 

Set the Item property of the Edit form to following:

If(
   !IsBlank(VarLastItems),
   VarLastItems,
   If(
      SourceGallery = "Gallery6",   // Check if you selected a item from your Gallery4 or Gallery6 against on the SourceGallery variable
      Gallery6.Selected,
      SourceGallery = "Gallery4",
      Gallery4.Selected
   )
)

Note: The DataSource property of the Edit form has been connected to 'Standards Selection Form Data Collection' already.

 

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

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (19,149)