cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tiemo_123
Helper II
Helper II

How to patch radio into SharePoint?

Hi,

 

My Radio (Radio1) has the following

 

Items

["Yes", "No"]

 

On my SharePoint List (Recruitment) there is a column called IsMember. IsMember has Choice as the Type and Yes, No for the Choices.

 

On my button (Button1), the patch statement is:

 

Patch(

'Recruitment',
Defaults('Recruitment'),
{

// Choices - Single Select

IsMember: Radio1.Selected.Value

}

)

;

 

How ever this still doesn't work. Can someone help me?

 

1 ACCEPTED SOLUTION

Accepted Solutions
tiemo_123
Helper II
Helper II

Hi @KvB1 ,

 

Thank you for your input.

I tried to do this before but it said that there was an error in the type of argument. So I Changed the Type to Single Line of Text rather than Choices

 

And then patched it using:

 

Patch

(
'Recruitment',
Defaults('Recruitment'),
{
// Single Line of text
IsMember: Radio1.Selected.Value

}

)

 

 

View solution in original post

9 REPLIES 9
timl
Super User
Super User

Hi @tiemo_123 

Does the following work for you?

Patch('Recruitment', 
      Defaults('Recruitment'),
      {
          IsMember:{
                     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                      Value:Radio1.Selected.Value
                   }
      }
)

 

Hi thank you for your input, but this did not work for me.

KvB1
Solution Specialist
Solution Specialist

Patch('Recruitment', 
      Defaults('Recruitment'),
      {
          IsMember: Radio1.Selected                   
      }
)

 

I think you could have figured it out ^^ It's pretty much a question of making sure you are matching the types of what you want to patch with what you want to patch

timl
Super User
Super User

@tiemo_123 

This syntax works for me in my test app. Can you explain why it fails for you? Do you get any error messages?

 

timl_0-1627305424673.png

 

Drrickryp
Super User
Super User

@tiemo_123 

Change the column type from choice to single line of text and it will work fine.

tiemo_123
Helper II
Helper II

Hi @KvB1 ,

 

Thank you for your input.

I tried to do this before but it said that there was an error in the type of argument. So I Changed the Type to Single Line of Text rather than Choices

 

And then patched it using:

 

Patch

(
'Recruitment',
Defaults('Recruitment'),
{
// Single Line of text
IsMember: Radio1.Selected.Value

}

)

 

 

View solution in original post

Drrickryp
Super User
Super User

@tiemo_123 

You can control the data saved in SharePoint by limiting the choices offered to the user in the PowerApps controls, similar to your radio control. The only problem here is that users with direct access to SharePoint can alter the data there and it may not be possible to prevent users with PowerApps access from getting into SharePoint.

Hi @timl 

 

This didn't work for me as the this argument did not match the expected type 'Text@. Found type record.

 

 

KvB1
Solution Specialist
Solution Specialist

If users wont be able to select multiple choices to populate a choice field in SharePoint, I greatly prefer to just make it a single line of text column rather than a choice column. Getting these types of arguments to match can be a pain sometimes.

 

So you changed your column type to single line of text right? 

 

The Radio1.Selected has argument type record.

In this record (basically a table) there is a column called value which has argument type text

So, Radio1.Selected.Value has argument type text

 

If the Items property of your radio control has a data source with different column name, you have to replace value with that column name

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,598)