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 III
Super User III

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 III
Super User III

@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 II
Super User II

@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 II
Super User II

@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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,207)