web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching error - argum...
Power Apps
Answered

Patching error - argument does not match expected type 'text'. Found type 'Error'.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, I am trying to patch (insert) new records from the powerapps to my sharepoint list. 

Error msg: 

The type of this argument 'BU_x002f_Dept' does not match the expected type 'Text'. Found type 'Error'. The function 'Patch' has some invalid arguments.

Tried to remove the entire row of BU/Dept: BU.SelectedText.Value, however the new error shows the duration. Same error as well, just that it is 'Number'.

 

Current Code as follows: 

 

Patch (
'Teams_Creation',
Defaults ('Teams_Creation'),
{
User_display_Name: Office365Users.MyProfileV2().givenName,
User_Email: Office365Users.MyProfileV2().mail,
'BU/Dept': BU.selectedtext.value,
Site: Site.Text,
Purpose: Purpose.Text,
Date_Required: DatePicker1.SelectedDate,
Members: Members.SelectedItems,
Duration: Duration.SelectedText.value,
Date_Requested: Today()
}
)

 

Additional Info on the Sharepoint List:

BU/Dept is the name of column, Single line of text Type

Duration is the name of column, Number Type. 

Categories:
I have the same question (0)
  • jimbobcook1 Profile Picture
    102 on at

    Could you encase the BU.selectedtext.value in Text() so Text(BU.selectedtext.value) to force the text field then for the number value just put Value(Duration.SelectedText.value)

     

    It's worth a try

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello Jimbobcook1,

     

    'BU/Dept': BU.selectedtext.value(), 

    and 

    'BU/Dept': Text(BU.selectedtext.value)

    Tried and it doesn't work, shows same error and added one more line of error "invocation of unknown function". 

    Likewise for the Duration. 

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Figured out my answer somehow. Pasting here so that it may help others who are new like me too. 

     

    Patch (
    Teams_Creation,
    Defaults (Teams_Creation),
    {
    //User_display_Name: Office365Users.MyprofileV2().givenName,
    Title: Office365Users.MyProfileV2().givenName,
    User_Email: Office365Users.MyProfileV2().mail,
    BU_x002f_Dept: BU.SelectedText.Value,
    Site: Site.Text,
    Purpose: Purpose.Text,
    Date_Required: DatePicker1.SelectedDate,
    Members: Left( Concat(Members.SelectedItems, 'Display Name' & ", "), Len( Concat(Members.SelectedItems, 'Display Name' & ", "))-2),
    Duration: Value(Duration.Text),
    Date_Requested:Today()
    }
    );

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard