cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jeysicca
Frequent Visitor

Gallery for Repeating Section with a Managed Metadata field not working properly

Hi,

 

I have a 2 lists that are used in one powerapps form. One of the lists has a content type that I created with a managed metadata. I created an example below:

 

Groups ListGroups List
Members List (with a content type and a managed metadata field)Members List (with a content type and a managed metadata field)

I created a form that I connected the two. In a group, there can be 1 or more members. So this is my form:

groups form.png

we have the groups section where the details are saved to the Groups list and the members section where the details are saved in the Members list. The members section is a gallery where you can add multiple members. When clicking the Add Member button, it is supposed to add one duplicate section for the student information. However, when I clicked it, it adds more than 1 duplicate just like this:

 

Groups form repeats more than 1.PNG

 

 

The formula for Add Member button is

 Add Member On Select.png

The LineDegree is the initialization of the Degree field because it is a Managed Metadata. While the Degree combo box has this formula to save it in the collection:

 

Degree On Change.png

 

Thanks for your help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @jeysicca ,

Could you please share a bit more about your issue?

Do you mean that it would create more than one duplicate section rather than one duplicate section within your Gallery when you click the "Add Member" button?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:2.JPG

 

3.JPG

Set the OnSelect property of the "Add Member" button to following:

Collect(
        MembersCollection,
        {
            LineTitle: "",
            LineYear: {
                Value: ""
            },
            LineDegree: {
                '@odata.type':"",
                TermGuid: "",
                WssId:"",
                Label: "",
                Path:"",
                Value: ""
            }
        }
)

Please check the following GIF screenshot for more details:Test.gif

 

Please check if you used another formula to add record into your MembersCollection. Also please check if you have typed your Collect() formula in other place of your app except the "Add Member" button.

 

In addition, please also consider take a try to add a Index column within your MembersCollection to act as Row Index. Please consider modify the Collect formula within the "Add Member" button as below:

Collect(
        MembersCollection,
        {
Index: CountRows(MembersColelction) + 1, LineTitle: "", LineYear: { Value: "" }, LineDegree: { '@odata.type':"", TermGuid: "", WssId:"", Label: "", Path:"", Value: "" } } )

Set the OnVisible property of the current screen to following:

Clear(MembersCollection);
Collect(
MembersCollection,
{
Index: CountRows(MembersColelction) + 1,
LineTitle: "",
LineYear: { Value: "" },
LineDegree: { '@odata.type':"", TermGuid: "", WssId:"", Label: "", Path:"", Value: "" }
}
)

Then please use UpdateIf() function to update records in your MembersCollection instead of Patch function. Modify your formula as below:

UpdateIf(
        MembersCollection,
Index = ThisItem.Index, { LineDegree: { '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy", TermGuid: DegreeComboBox.Selected.TermGuid, WssId: DegreeComboBox.Selected.WssId, Label: DegreeComboBox.Selected.Label, Path: DegreeComboBox.Selected.Path, Value: DegreeComboBox.Selected.Value } } )

Please take a try with above solution, then check if the issue is solved.

 

If the issue still exists, please consider re-create a new app, then take a try with above solution I provided, then check if the issue is solved.

 

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

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @jeysicca ,

Could you please share a bit more about your issue?

Do you mean that it would create more than one duplicate section rather than one duplicate section within your Gallery when you click the "Add Member" button?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:2.JPG

 

3.JPG

Set the OnSelect property of the "Add Member" button to following:

Collect(
        MembersCollection,
        {
            LineTitle: "",
            LineYear: {
                Value: ""
            },
            LineDegree: {
                '@odata.type':"",
                TermGuid: "",
                WssId:"",
                Label: "",
                Path:"",
                Value: ""
            }
        }
)

Please check the following GIF screenshot for more details:Test.gif

 

Please check if you used another formula to add record into your MembersCollection. Also please check if you have typed your Collect() formula in other place of your app except the "Add Member" button.

 

In addition, please also consider take a try to add a Index column within your MembersCollection to act as Row Index. Please consider modify the Collect formula within the "Add Member" button as below:

Collect(
        MembersCollection,
        {
Index: CountRows(MembersColelction) + 1, LineTitle: "", LineYear: { Value: "" }, LineDegree: { '@odata.type':"", TermGuid: "", WssId:"", Label: "", Path:"", Value: "" } } )

Set the OnVisible property of the current screen to following:

Clear(MembersCollection);
Collect(
MembersCollection,
{
Index: CountRows(MembersColelction) + 1,
LineTitle: "",
LineYear: { Value: "" },
LineDegree: { '@odata.type':"", TermGuid: "", WssId:"", Label: "", Path:"", Value: "" }
}
)

Then please use UpdateIf() function to update records in your MembersCollection instead of Patch function. Modify your formula as below:

UpdateIf(
        MembersCollection,
Index = ThisItem.Index, { LineDegree: { '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy", TermGuid: DegreeComboBox.Selected.TermGuid, WssId: DegreeComboBox.Selected.WssId, Label: DegreeComboBox.Selected.Label, Path: DegreeComboBox.Selected.Path, Value: DegreeComboBox.Selected.Value } } )

Please take a try with above solution, then check if the issue is solved.

 

If the issue still exists, please consider re-create a new app, then take a try with above solution I provided, then check if the issue is solved.

 

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

This worked. I applied this on my form. It has a side effect on my form tho. Thank you so much.


@v-xida-msft wrote:

Hi @jeysicca ,

Could you please share a bit more about your issue?

Do you mean that it would create more than one duplicate section rather than one duplicate section within your Gallery when you click the "Add Member" button?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:2.JPG

 

3.JPG

Set the OnSelect property of the "Add Member" button to following:

Collect(
        MembersCollection,
        {
            LineTitle: "",
            LineYear: {
                Value: ""
            },
            LineDegree: {
                '@odata.type':"",
                TermGuid: "",
                WssId:"",
                Label: "",
                Path:"",
                Value: ""
            }
        }
)

Please check the following GIF screenshot for more details:Test.gif

 

Please check if you used another formula to add record into your MembersCollection. Also please check if you have typed your Collect() formula in other place of your app except the "Add Member" button.

 

In addition, please also consider take a try to add a Index column within your MembersCollection to act as Row Index. Please consider modify the Collect formula within the "Add Member" button as below:

Collect(
        MembersCollection,
        {
Index: CountRows(MembersColelction) + 1, LineTitle: "", LineYear: { Value: "" }, LineDegree: { '@odata.type':"", TermGuid: "", WssId:"", Label: "", Path:"", Value: "" } } )

Set the OnVisible property of the current screen to following:

Clear(MembersCollection);
Collect(
MembersCollection,
{
Index: CountRows(MembersColelction) + 1,
LineTitle: "",
LineYear: { Value: "" },
LineDegree: { '@odata.type':"", TermGuid: "", WssId:"", Label: "", Path:"", Value: "" }
}
)

Then please use UpdateIf() function to update records in your MembersCollection instead of Patch function. Modify your formula as below:

UpdateIf(
        MembersCollection,
Index = ThisItem.Index, { LineDegree: { '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy", TermGuid: DegreeComboBox.Selected.TermGuid, WssId: DegreeComboBox.Selected.WssId, Label: DegreeComboBox.Selected.Label, Path: DegreeComboBox.Selected.Path, Value: DegreeComboBox.Selected.Value } } )

Please take a try with above solution, then check if the issue is solved.

 

If the issue still exists, please consider re-create a new app, then take a try with above solution I provided, then check if the issue is solved.

 

Best regards,


 

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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,552)