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 / Patch function not wor...
Power Apps
Unanswered

Patch function not working

(0) ShareShare
ReportReport
Posted on by 232

Hello, I'm rebuilding my PowerApp in a new tenant and I have copied all of my SP lists and formulas over as well. For some reason the formula that I have isn't working now. It works fine in the old one, but it doesn't work in the new one. I have provided my error and the code below. This function works fine in my other powerapps. I set it up under a different microsoft account in a different browser as well:

 

Screen Shot 2022-09-08 at 4.52.02 PM.png

 

Patch('Employee Activity List',
{
Employee:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:Concatenate("i:0#.f|membership|",User().Email),
DisplayName:User().FullName,
Email:User().Email,
Department:"",
JobTitle:"",
Picture:""
},

'Manager SharePoint Group': varManagerSpGroup,

'Employee Note': 'Employee Note Input'.Text,

Category:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:'Category Input'.Selected.ID,
Value:'Category Input'.Selected.Title},


Activity:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:'Activity Input'.Selected.ID,
Value:'Activity Input'.Selected.'Activity Name'},

Status:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:LookUp('Status Source List',Title = "Needs Approval", ID),
Value:LookUp('Status Source List',Title = "Needs Approval", Title)},

'Difficulty (Time)': LookUp('Activity Source List', 'Activity Name' = 'Activity Input'.Selected.'Activity Name').'Difficulty (Time)',

'Value to Company': LookUp('Activity Source List', 'Activity Name' = 'Activity Input'.Selected.'Activity Name').'Value to Company',

Points:LookUp('Difficulty Source List', Title = LookUp('Activity Source List', 'Activity Name' = 'Activity Input'.Selected.'Activity Name').'Difficulty (Time)'.Value).'Default Values' * LookUp('Value to Company Source List', Title = LookUp('Activity Source List', 'Activity Name' = 'Activity Input'.Selected.'Activity Name').'Value to Company'.Value).'Default Values',


'Submission Date':Now()

});
Reset('Category Input');
Reset('Activity Input');
Reset('Employee Note Input');
Navigate(Screen2, ScreenTransition.Fade);

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Dknight7 

    How are you setting varManagerSpGroup?

  • Dknight7 Profile Picture
    232 on at

    Its above my patch fucntion:

     

    Set(varManagerGroup, 'Category Input'.Selected.'Manager Group');

    If(IsBlank(varManagerGroup.Value),
    //Selected category's manager group is blank
    Set(varDivisionName, LookUp('Employee Source List', 'Employee Name'.DisplayName = User().FullName).'Employee Division'.Value);
    Set(varOutput, varDivisionName);

    Set(varManagerSpGroup, LookUp('Division Source List', 'Division Name' = varDivisionName).'Division Manager Group'),
    Set(varManagerSpGroup, LookUp('Manager Group Source List', Category = varManagerGroup.Value).'SharePoint Group')
    );

    Patch('Employee Activity List',
    {
    Employee:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    Claims:Concatenate("i:0#.f|membership|",User().Email),
    DisplayName:User().FullName,
    Email:User().Email,
    Department:"",
    JobTitle:"",
    Picture:""
    },

    'Manager SharePoint Group': varManagerSpGroup,

    'Employee Note': 'Employee Note Input'.Text,

    Category:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id:'Category Input'.Selected.ID,
    Value:'Category Input'.Selected.Title},


    Activity:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id:'Activity Input'.Selected.ID,
    Value:'Activity Input'.Selected.'Activity Name'},

    Status:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id:LookUp('Status Source List',StatusID = "Needs Approval", ID),
    Value:LookUp('Status Source List',StatusID = "Needs Approval", StatusID)},

    'Difficulty (Time)': LookUp('Activity Source List', 'Activity Name' = 'Activity Input'.Selected.'Activity Name').'Difficulty (Time)',

    'Value to Company': LookUp('Activity Source List', 'Activity Name' = 'Activity Input'.Selected.'Activity Name').'Value to Company',

    Points:LookUp('Difficulty Source List', 'Level ID' = LookUp('Activity Source List', 'Activity Name' = 'Activity Input'.Selected.'Activity Name').'Difficulty (Time)'.Value).'Default Values' * LookUp('Value to Company Source List', ValueID = LookUp('Activity Source List', 'Activity Name' = 'Activity Input'.Selected.'Activity Name').'Value to Company'.Value).'Default Values',


    'Submission Date':Now()

    });

    Reset('Category Input');
    Reset('Activity Input');
    Reset('Employee Note Input');
    Navigate(Screen2, ScreenTransition.Fade);

  • Dknight7 Profile Picture
    232 on at

    Screen Shot 2022-09-08 at 6.01.25 PM.png

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Dknight7 

    Okay, that is coming from a 'Category Input' control.  What is the Items property of that control?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Dknight7 

    Oh...and I am going on an assumption here...what kind of column is 'Manager SharePoint Group'?

     

    In fact, fill in the missing (or incorrect assumptions of your column types):

    Employee:  Person Column
    'Manager SharePoint Group':  unknown
    'Employee Note': Single Text
    Category: Single Value Lookup
    Activity:  Single Value Lookup
    Status: Single Value Lookup
    'Difficulty (Time)': DateTime
    'Value to Company': either Single Text or Numeric
    Points: either Single Text or Numeric
    'Submission Date': DateTime 

  • Dknight7 Profile Picture
    232 on at

    The category input property is this (Title isn't popping up when I select the value):

    Screen Shot 2022-09-08 at 6.37.11 PM.png

     

    but it's supposed to be like this. (This is the powerapp on my old tenant):

    Screen Shot 2022-09-08 at 6.40.42 PM.png

  • Dknight7 Profile Picture
    232 on at

    Employee:  Person Column
    'Manager SharePoint Group': Person Column
    'Employee Note': Single Text
    Category: Single Value Lookup
    Activity:  Single Value Lookup
    Status: Single Value Lookup
    'Difficulty (Time)': DateTime
    'Value to Company': either Single Text or Numeric
    Points: either Single Text or Numeric
    'Submission Date': DateTime 

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Dknight7 

    Thanks for filling in the column types!   The problem is most likely occurring with the Manager column.

     

    Let's look at that dropdown!  What exactly is the Items property of that control?  As seen in the formula editor, not in the property pane (sometimes it masks the real formula).

  • Dknight7 Profile Picture
    232 on at

     

    This is what's in it. Same as the other tenant

    Screen Shot 2022-09-08 at 6.50.08 PM.png

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Dknight7 

    Tell me more about 'Category Source List'.

    Is this too a SharePoint list?  What kind of columns does it have (or those that are of primary concern)?

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard