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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error : The type of th...
Power Apps
Answered

Error : The type of this argument ... does not match the expected type 'OptionSetValue

(0) ShareShare
ReportReport
Posted on by 11

I am building the canvas app for the power apps challenge , and I was doing well until trying to update the Animal_Shelter Status I get an error I cant seem to get by this is my formula in my save button:

Patch(

'Foster Families',

Defaults('Foster Families'),

{

Foster_ID: Foster_ID_DataCard1.Default,

'Foster_Claimer Name': DataCardValue_ClaimerName.Default,

'Foster_Join Date': Today(),

'Foster_Local Shelter': SelectedShelter_name,

Foster_Location: Foster_Location_DataCard2.Default

}

);

 

// Provide feedback to the user

Notify("Foster family record saved successfully!", NotificationType.Success);

 

Patch(

Animals,

LookUp(Animals, Animal_ID = Animal_ID),

{

'Animal_Shelter Status': Value(3), // this is where I cant update this value to choice 3 label in foster home

'Animal_Current Location': SelectedShelter_ID,

'Animal_Foster Claimer': Foster_ID_DataCard1.Default

}

);

 

// Provide user feedback

Notify("Foster animal record updated successfully!", NotificationType.Success);

 

 this is the errror I am getting:

The type of this argument 'jcfph_shelterstatus' does not match the expected type 'OptionSetValue (Animal_Shelter Status (Animals))'

 these are the ways I have tried to set that value:

'Animal_Shelter Status': { Value: 3 },

'Animal_Shelter Status': 3,

Animal_Shelter_Status: "In Foster Home",

I get in all the same expected type optionsetvalue

 

 

 
Screen Shot 2024-12-11 at 10.51.24 AM.png
I have the same question (0)
  • CU21101747-0 Profile Picture
    11 on at

    I tried this :
    'Animal_Shelter Status': LookUp(Choices(Animals.'Animal_Shelter Status'), Value = 3),

    same error:
    The type of this argument 'jcfph_shelterstatus' does not match the expected type 'OptionSetValue (Animal_Shelter Status (Animals))'. Found type 'Record'.
  • Suggested answer
    CU21101747-0 Profile Picture
    11 on at
    I think this is the correct syntax:
    'Animal_Shelter Status': 'Animal_Shelter Status (Animals)' .'In Foster Home',
  • Verified answer
    SpongYe Profile Picture
    5,715 Super User 2025 Season 2 on at
    You are getting this error because you can not fill a Animal_Shelter Status with just a value. 
     
    You code should look like:
    Patch(
        Animals,
        LookUp(Animals, Animal_ID = Animal_ID),
        {
            'Animal_Shelter Status': 'Animal_Shelter Status (Animals)'.'In Foster Home' //remove 'In Foster Home' and set the dot to set the real value
            'Animal_Current Location': SelectedShelter_ID,
            'Animal_Foster Claimer': Foster_ID_DataCard1.Default
        }
    );
    This will solve the problem. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 445

#2
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 321 Super User 2025 Season 2

Last 30 days Overall leaderboard