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

Combobox DefaultSelectedItems within a gallery

I'm having trouble getting combo box to display data from a collection. The save icon in each gallery item patches the contents of the fields. The screen shots show the outcome of pressing the save icon.

 

Screen Shot 2019-10-14 at 16.41.19.png

 

Screen Shot 2019-10-14 at 16.42.58.png

 

OnSelect of the Save Icon patches to a collection and also creates a new blank row.

Patch(
    colTimecards,
    ThisItem,
    {
        EditMode: false,
        ProjectName: cb_ProjectName.Selected.'Project Name',
        Employee: cb_Employee.Selected.DisplayName,
        WeekNumber: dd_WeekNumber.SelectedText.Value,
        WeekCommencing: date_WeekCommencing.SelectedDate,
        Year: txt_Year.Text,
        Hours: txt_Hours.Text,
        Cost: txt_Cost.Text
    }
);
// If edit button has been pressed don't create a new blank row
If(
    !varEditPressed,
    Collect(
        colTimecards,
        {
            EditMode: true,
            ProjectName: "",
            Employee: "",
            WeekNumber: "1",
            WeekCommencing: "",
            Year: Text(Today(),"[$-en-GB]yyyy"),
            Hours: "",
            Cost: ""
        }
    )
);

I understand DefaultSelectedItems expects a Record, so I've tried the following...

 

First(Filter(colTimecards,ProjectName=ThisItem.ProjectName))

Also tried using LookUp, as well as trying similar formulae on the default property of the combobox.

 

Any suggestions would be gratefully received.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Digital
Level: Powered On

Re: Combobox DefaultSelectedItems within a gallery

@v-yutliu-msft ,

 

Thank you for your reply. The issue was related to a data type mismatch.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Combobox DefaultSelectedItems within a gallery

Hi @Digital ,

Do you mean that you can not display value in the combo box of ProjectName field?

Could you tell me 

1)the items property of cb_ProjectName combo box?

2)the data type of ProjectName field?

3)whether this field name is ProjectName or 'Project Name'?

I notice that some places you use ProjectName, while others you use  'Project Name'.

Please make sure that you are using the right field name.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Digital
Level: Powered On

Re: Combobox DefaultSelectedItems within a gallery

@v-yutliu-msft ,

 

Thank you for your reply. The issue was related to a data type mismatch.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 101 members 5,332 guests
Please welcome our newest community members: