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
)
Solved! Go to Solution.
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,
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,
@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,
User | Count |
---|---|
227 | |
98 | |
95 | |
56 | |
33 |
User | Count |
---|---|
279 | |
108 | |
107 | |
64 | |
62 |