cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Veblitz
Helper III
Helper III

Editable table gallery using patch for complex field types Lookup/choice

I have gallery control and need to edit the items for complex field columns like Lookup field type,choice type in sharepoint list so when I select item and click edit button in my gallery it basically redirects to another screen where I need to edit the lookup field value,choice field columns for the gallery1 selected items and then use update patch,this i am able to achieve for single line of texts values. 

 

Further my issue is i need to fetch the gallery1 selected item to the below fields

 

Lookup field:  (used combo box and items property corresponds to lookup list)

Choice field:(used dropdown and items property corresponds to collection name)

 

I tried to set the default property for the above fields to gallery1.selected.value but its not showing the gallery1 selected item since its throws error as  "Expected value"

 

I am not sure how to fetch the gallery1 selected  item value to the above complex fields.

 

Appreciate kind help in this regards

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Veblitz,

Could you please share more about your Gallery configuration, provide a screenshot.

Tell me that how you set the Items property of the ComBo Box, please provide your specific formula?

Tell me that how you set the Items property of the Dropdown, a column within a collection?

Actually, a Default property of the Dropdown expects a value rather than a record. Gallery1.Selected is a type of record which leads to invalid argument type.

I assume that you have 2 screens, Screen1 is a Gallery including multi TextInputs for you to edit Text field, Screen2 includes a Combo Box and a Dropdown for you to update the LookUp field and Choice field.

I have a similar test for you, please check as below.

My Combo Box4 Items:

'Work Requests'.Status // 'Work Requests' is my lookup list 

My Combo Box4 DefaultSelectedItems:

Gallery3.Selected.LookUP // LookUP is the LookUp field in my main list

My Dropdown2 Items:

colData.JoblineID // colData is my collection and JoblineID is a column within it

My Dropdown2 Default:

Gallery3.Selected.CH.Value // CH is a Choice field in my main list

If you want to patch Choice field and LookUp field, please set the OnSelect as below:

Patch(
    DefaultSelectedItem, // DefaultSelectedItem is my main list
    Gallery3.Selected,
    {
        LookUP: {
            Value: ComboBox4.Selected.Status,
            Id: LookUp(
                'Work Requests',
                Status = ComboBox4.Selected.Status
            ).ID
        },CH:{Value:Dropdown2.Selected.JoblineID}
    }
)

Note that a LookUp field in SP list has a special schema as follows:

LookUpField: {
            Value: SpecificValue,
            Id:ID // ID is from the lookup list, so you need to use the LookUp() to find it
              }

Hope it could help you.

Regards,

Qi

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @Veblitz,

Could you please share more about your Gallery configuration, provide a screenshot.

Tell me that how you set the Items property of the ComBo Box, please provide your specific formula?

Tell me that how you set the Items property of the Dropdown, a column within a collection?

Actually, a Default property of the Dropdown expects a value rather than a record. Gallery1.Selected is a type of record which leads to invalid argument type.

I assume that you have 2 screens, Screen1 is a Gallery including multi TextInputs for you to edit Text field, Screen2 includes a Combo Box and a Dropdown for you to update the LookUp field and Choice field.

I have a similar test for you, please check as below.

My Combo Box4 Items:

'Work Requests'.Status // 'Work Requests' is my lookup list 

My Combo Box4 DefaultSelectedItems:

Gallery3.Selected.LookUP // LookUP is the LookUp field in my main list

My Dropdown2 Items:

colData.JoblineID // colData is my collection and JoblineID is a column within it

My Dropdown2 Default:

Gallery3.Selected.CH.Value // CH is a Choice field in my main list

If you want to patch Choice field and LookUp field, please set the OnSelect as below:

Patch(
    DefaultSelectedItem, // DefaultSelectedItem is my main list
    Gallery3.Selected,
    {
        LookUP: {
            Value: ComboBox4.Selected.Status,
            Id: LookUp(
                'Work Requests',
                Status = ComboBox4.Selected.Status
            ).ID
        },CH:{Value:Dropdown2.Selected.JoblineID}
    }
)

Note that a LookUp field in SP list has a special schema as follows:

LookUpField: {
            Value: SpecificValue,
            Id:ID // ID is from the lookup list, so you need to use the LookUp() to find it
              }

Hope it could help you.

Regards,

Qi

Best Regards,
Qi

View solution in original post

Thanks.

Im trying auto edit my gallery for lookup fields and choice fields by placing combo box for lookup and dropdown for choice by placing  patch function in the onchange property but when i try to add new item in another screen then navigating to gallery screen then its not displaying the new values in that gallery.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (2,398)