cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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.

View solution in original post

1 REPLY 1
Highlighted
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.

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 (Last 30 Days)
Users online (4,014)