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

Connecting to a Sharepoint List Column that has a drop down

Hello!

I am currently getting errors when I am trying to use Patch to send variables collected in the Power APP to a sharepoint list.

 

These errors are being caused by the columns that have a drop down select in the Sharepoint list. I know that if i removed the drop down function from these that the Patch will work. However i do want to leave both as they are.

 

Have any of you run into problems like this?

If you have any questions please let me know!

 

Thanks

Stephen

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Connecting to a Sharepoint List Column that has a drop down

Hi@PowerAppSteve,

Based on the issue that you mentioned, do you want to save data to the columns that have a drop-down selection within your SP list?

Could you please share a bit more about your scenario:

  1. How you write your Patch code?
  2. Are these columns Choice type or Lookup type?

If these columns are Lookup type, you have already connected your dropdown list to the Lookup column when you created it. However, there is a little different from the Choice type column when using the Patch() function.

In my scenario, the 'Option' column is a Lookup type where stores the values from a column named 'Employee' belonging to another SP list. Further, the values within the 'Employee' column have the corresponding ID which should be referred within your Patch() function.

Based on your issue, the formula should be set to the OnSelect property of a Button as following

 

Patch(
    Test0910,
    LookUp(
        Test0910,
        ID = 1
    ),
    {
        Option: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
            Id: 3,
            Value: DataCardValue4.Selected.Value
        }
    }
)

 

Note: Id=3 represents the third value within the 'Employee' column where the 'Option' column gets information from. The DataCardValue4 represents the ComboBox where selects from the 'Option' column.

Best Regards,

Qi

 

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Connecting to a Sharepoint List Column that has a drop down

@PowerAppSteve 

Yes, to use Patch on a Choice column, you will need to implement a formula such as this:

Patch(yourDataSource, yourDataRecord,
    {
        yourChoiceColumns:
            {
                Value: "aValidValueForYourColumn",
               '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
            }
    }
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: Connecting to a Sharepoint List Column that has a drop down

Thanks for getting back to me. 
Do i need to connect the drop down list in any different way than just a normal data source connection?

Highlighted
Super User III
Super User III

Re: Connecting to a Sharepoint List Column that has a drop down

@PowerAppSteve 

No, you shouldn't have to make any other alterations to that.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Microsoft
Microsoft

Re: Connecting to a Sharepoint List Column that has a drop down

Hi@PowerAppSteve,

Based on the issue that you mentioned, do you want to save data to the columns that have a drop-down selection within your SP list?

Could you please share a bit more about your scenario:

  1. How you write your Patch code?
  2. Are these columns Choice type or Lookup type?

If these columns are Lookup type, you have already connected your dropdown list to the Lookup column when you created it. However, there is a little different from the Choice type column when using the Patch() function.

In my scenario, the 'Option' column is a Lookup type where stores the values from a column named 'Employee' belonging to another SP list. Further, the values within the 'Employee' column have the corresponding ID which should be referred within your Patch() function.

Based on your issue, the formula should be set to the OnSelect property of a Button as following

 

Patch(
    Test0910,
    LookUp(
        Test0910,
        ID = 1
    ),
    {
        Option: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
            Id: 3,
            Value: DataCardValue4.Selected.Value
        }
    }
)

 

Note: Id=3 represents the third value within the 'Employee' column where the 'Option' column gets information from. The DataCardValue4 represents the ComboBox where selects from the 'Option' column.

Best Regards,

Qi

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,392)