cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elgin
Level: Powered On

ClearCollect exta items

I'm using ClearCollect to setup the text for 2 buttons. The resulting collections have a 3rd blank entry. Here's the ClearCollect code:

 

ClearCollect(
LeaveTypeCollection,
{
type:"Vacation",
icon:vacation,
iconselected:'vacation-selected',
description:
"Vacation leave is provided to all employees for the purpose of rest, relaxation, and to attend to personal affairs. Vacation balance is acquired over time and can be used at any time."
}
,
{
type:"Sick Leave",
icon:'sick-leave',
iconselected:'sick-leave-selected',
description:"Sick leave may be used for your own illness or medical/dental appointments or for the illness or medical/dental appointments of family members. Sick leave can also be used to address the psychological, physical, or legal aspects of domestic violence, sexual assault, stalking, or other crime. You may not use sick leave for vacation purposes. Some cities and states have specific laws governing sick leave that allow use of sick leave to care for other family members."
}
)

 

Here's the screen showing the result:

LeaveType.pngButtons from ClearCollect

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: ClearCollect exta items

Hi @Elgin,

Could you please share more details about the LeaveTypeCollection within your app?

Do you create an app using the built-in "Leave Request" template app?

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

 

2.JPG

Set the OnStart property of the first screen of my app to following:

Concurrent(
    //collection used in the left nav menu
  ...

    //collection used in the left nav menu
  ...

    //add custom leave types to this collection to make them show up in the app
    ClearCollect(       /* <- Start */
        LeaveTypeCollection, 
        Table(
                {
                    type:"Vacation", 
                    icon:vacation,
                    iconselected:'vacation-selected',
                    description:
                    "Vacation leave is provided to all employees for the purpose of rest, relaxation, and to attend to personal affairs. Vacation balance is acquired over time and can be used at any time."
                }
                ,
                {
                    type:"Sick Leave", 
                    icon:'sick-leave', 
                    iconselected:'sick-leave-selected',
                    description:"Sick leave may be used for your own illness or medical/dental appointments or for the illness or medical/dental appointments of family members. Sick leave can also be used to address the psychological, physical, or legal aspects of domestic violence, sexual assault, stalking, or other crime. You may not use sick leave for vacation purposes. Some cities and states have specific laws governing sick leave that allow use of sick leave to care for other family members."
                }
            )
    ),            /* <- End */
    //defines leave start and end for requests. Default set to Now since most users will be creating new requests. Changes to reflect leave times for requests which are being edited
    ...
);
...

On your side, you should type the following:

Clear(LeaveTypeCollection);   /* <- Add this formula on your side */
Concurrent( //collection used in the left nav menu ... //collection used in the left nav menu ... //add custom leave types to this collection to make them show up in the app ClearCollect( /* <- Start */ LeaveTypeCollection, Table( { type: "Vacation", icon: vacation, iconselected: 'vacation-selected', description: "Vacation leave is provided to all employees for the purpose of rest, relaxation, and to attend to personal affairs. Vacation balance is acquired over time and can be used at any time." }, { type: "Sick Leave", icon: 'sick-leave', iconselected: 'sick-leave-selected', description: "Sick leave may be used for your own illness or medical/dental appointments or for the illness or medical/dental appointments of family members. Sick leave can also be used to address the psychological, physical, or legal aspects of domestic violence, sexual assault, stalking, or other crime. You may not use sick leave for vacation purposes. Some cities and states have specific laws governing sick leave that allow use of sick leave to care for other family members." } ) ), /* <- End */ //defines leave start and end for requests. Default set to Now since most users will be creating new requests. Changes to reflect leave times for requests which are being edited ... ); ...

then re-load your app, then check if the issue is solved.

If the issue still exists, please consider take a try to re-create a new app based on this built-in "Leave Request" template app, modify formula within the OnStart property of the first screen of your app as above, then check if the issue still exists.

 

Best regards,

Kris

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.
2 REPLIES 2
Elgin
Level: Powered On

Re: ClearCollect exta items

Additional info.

The collection is accurate, having only the 2 items. The issue may be related to the buttons on the gallery:

1. AboutLeaveTypeGallery is based on LeaveTypeCollection (2 items).

2. This gallery has three objects: AboutLeaveTypeIcon, AboutLeaveTypeLabel, AboutLeaveTypeButton. These objects are stacked.

 

As soon as I add a button onto the gallery, I get multiple buttons.

 

What may be happening is the browser caching the gallery items. Possible?

 

 

Community Support Team
Community Support Team

Re: ClearCollect exta items

Hi @Elgin,

Could you please share more details about the LeaveTypeCollection within your app?

Do you create an app using the built-in "Leave Request" template app?

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

 

2.JPG

Set the OnStart property of the first screen of my app to following:

Concurrent(
    //collection used in the left nav menu
  ...

    //collection used in the left nav menu
  ...

    //add custom leave types to this collection to make them show up in the app
    ClearCollect(       /* <- Start */
        LeaveTypeCollection, 
        Table(
                {
                    type:"Vacation", 
                    icon:vacation,
                    iconselected:'vacation-selected',
                    description:
                    "Vacation leave is provided to all employees for the purpose of rest, relaxation, and to attend to personal affairs. Vacation balance is acquired over time and can be used at any time."
                }
                ,
                {
                    type:"Sick Leave", 
                    icon:'sick-leave', 
                    iconselected:'sick-leave-selected',
                    description:"Sick leave may be used for your own illness or medical/dental appointments or for the illness or medical/dental appointments of family members. Sick leave can also be used to address the psychological, physical, or legal aspects of domestic violence, sexual assault, stalking, or other crime. You may not use sick leave for vacation purposes. Some cities and states have specific laws governing sick leave that allow use of sick leave to care for other family members."
                }
            )
    ),            /* <- End */
    //defines leave start and end for requests. Default set to Now since most users will be creating new requests. Changes to reflect leave times for requests which are being edited
    ...
);
...

On your side, you should type the following:

Clear(LeaveTypeCollection);   /* <- Add this formula on your side */
Concurrent( //collection used in the left nav menu ... //collection used in the left nav menu ... //add custom leave types to this collection to make them show up in the app ClearCollect( /* <- Start */ LeaveTypeCollection, Table( { type: "Vacation", icon: vacation, iconselected: 'vacation-selected', description: "Vacation leave is provided to all employees for the purpose of rest, relaxation, and to attend to personal affairs. Vacation balance is acquired over time and can be used at any time." }, { type: "Sick Leave", icon: 'sick-leave', iconselected: 'sick-leave-selected', description: "Sick leave may be used for your own illness or medical/dental appointments or for the illness or medical/dental appointments of family members. Sick leave can also be used to address the psychological, physical, or legal aspects of domestic violence, sexual assault, stalking, or other crime. You may not use sick leave for vacation purposes. Some cities and states have specific laws governing sick leave that allow use of sick leave to care for other family members." } ) ), /* <- End */ //defines leave start and end for requests. Default set to Now since most users will be creating new requests. Changes to reflect leave times for requests which are being edited ... ); ...

then re-load your app, then check if the issue is solved.

If the issue still exists, please consider take a try to re-create a new app based on this built-in "Leave Request" template app, modify formula within the OnStart property of the first screen of your app as above, then check if the issue still exists.

 

Best regards,

Kris

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.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 45 members 4,297 guests
Please welcome our newest community members: