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

Inserting a data from a choice to Sharepoint list

Hi All,

 

I am having issues inserting data from a drop down into sharepoint list.

The name of my sharepoint list is New Product IVF and the name of the field is Current Classification Sydney. It is also a Choice type.

 

I have tried the below so far.

OnSelect in the button:

 

Patch('New Product IVF','New Product IVF'.'Current Classification Sydney', Dropdown1.Selected)

 

Also tried

 

Choices('New Product IVF'.'Current Classification Sydney') ( This dosent seem to have any error but not sure how to submit)

 

The only reason I need to do this is because if I use fields, they are stuck on a specific location of the form and are not flexible in being moved around.

 

Any help is really appreciated. Thank-you 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Inserting a data from a choice to Sharepoint list

@Vishal2 

This is a common confusion with choice columns and getting them set properly.

Let's start with the DropDown though...what is the Items property of the DropDown?  That will actually help determine what your formula should be.

 

If you are getting the full records for the Items property, then you can use that selected item in your patch. But, 9 times out of 10, you have some other limiting formula on the dropdown that will cause the dropdown to only have the values of the choices.

In that case, you will need to supplement your OnSelect formula to be something similar to this:

Patch('New Product IVF',
yourRecord,
{'Current Classification Sydney':
{Value: Dropdown1.Selected.Value,
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
}
)

Note a couple of things here:

1) in red is the record you want to patch parameter.  You need to specify what record to patch in your patch statement.  If it is a new record, then you can use Defaults('New Product IVF').  If it is an existing record, then you either need to reference it from a Form or a Gallery with ThisItem, or use a Lookup to lookup the record from the datasource.  Either way, you must supply this parameter.

2) in blue is the syntax for patching a choice column.  In this case, we must supply a record to the column.  That record is comprised of the Value and an odata.type specification.  Again, this information can be part of the dropdown items depending on that Items property formula.  But, if not and only values are in the dropdown, then you need to supply the proper record for the column.

 

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.
1 REPLY 1
Super User
Super User

Re: Inserting a data from a choice to Sharepoint list

@Vishal2 

This is a common confusion with choice columns and getting them set properly.

Let's start with the DropDown though...what is the Items property of the DropDown?  That will actually help determine what your formula should be.

 

If you are getting the full records for the Items property, then you can use that selected item in your patch. But, 9 times out of 10, you have some other limiting formula on the dropdown that will cause the dropdown to only have the values of the choices.

In that case, you will need to supplement your OnSelect formula to be something similar to this:

Patch('New Product IVF',
yourRecord,
{'Current Classification Sydney':
{Value: Dropdown1.Selected.Value,
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
}
)

Note a couple of things here:

1) in red is the record you want to patch parameter.  You need to specify what record to patch in your patch statement.  If it is a new record, then you can use Defaults('New Product IVF').  If it is an existing record, then you either need to reference it from a Form or a Gallery with ThisItem, or use a Lookup to lookup the record from the datasource.  Either way, you must supply this parameter.

2) in blue is the syntax for patching a choice column.  In this case, we must supply a record to the column.  That record is comprised of the Value and an odata.type specification.  Again, this information can be part of the dropdown items depending on that Items property formula.  But, if not and only values are in the dropdown, then you need to supply the proper record for the column.

 

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.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 192 members 4,053 guests
Please welcome our newest community members: