cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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 @Anonymous 

Does the following work for you?

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

 

Anonymous
Not applicable

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

KvB1
Solution Sage
Solution Sage

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

@Anonymous 

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

@Anonymous 

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

Anonymous
Not applicable

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

}

)

 

 

Drrickryp
Super User
Super User

@Anonymous 

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.

Anonymous
Not applicable

Hi @timl 

 

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

 

 

KvB1
Solution Sage
Solution Sage

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,322)