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 Apps
Unanswered

Patch a Number

(0) ShareShare
ReportReport
Posted on by 84

I have a SharePoint list with a Project_Number column that is formatted as a number.  I am trying to patch a number to this field, but it just won't patch.  All of the other fields in my patch statement are patching correctly including other number fields.  I get no errors in PowerApps.  But Project_Number keeps coming up blank in SharePoint for any new record.  It is quite baffling.  Any ideas on what the root cause could be?  Thanks in advance.

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    on at

    Hi @Pegger ,

     

    Could you please show the formula?

    Have you tried to patch a number to test the number column?

    Patch(List,Defaults(List),{Project_Number:123})

     

    Best regards,

    Rimmon

  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    Hi @Pegger ,

    I assume you have the value in a Text control - if so, you might need

    Project_Number: Value(TextInputName.Text)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Pegger Profile Picture
    84 on at

    Set(_var_projname,Project_Dropdown.Selected,Value);

    Set(_var_projnum,Lookup(Projects, Project_Name =_var+projname,Project_Number));

    Patch(Comments,{Project_Number: _var_projnum},{Comment_Number: _var_commnum});

     

    The Project_Number field in list "Projects" is a Number format.  And even when I don't use the variable, and replace it with a 1, it doesn't patch the project number.

  • VishalJhaveri Profile Picture
    1,167 Moderator on at

    Read this super useful article to master CRUD Operations in Power Apps.
    Master CRUD Operations in Power Apps : Part 4 (inkeysolutions.com)

  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at
    Set(_var_projname, Project_Dropdown.Selected,Value);
    
    Set(_var_projnum, Lookup(Projects, Project_Name =_var_projname, Project_Number));
    
    Patch(Comments,Lookup(Projects, Project_Name =_var_projname),{Comment_Number: _var_commnum});

     

    Your patch should look up the record its trying to patch, so you can use the same lookup you used before instead of getting the project number only to try lookup in projects something that you have already looked up.

    I can see in your line above you had _var+ where it should probably have referenced the variable you set above _var_projnum

  • Verified answer
    Pegger Profile Picture
    84 on at

    So, after much trial and error.  I found the solution.  My patch statement included individual curly brackets for each field being patched... Patch(Comments,{{Project_Number: _var_projnum},{Comment_Number: _var_commnum}});

     

    The patch would execute for all fields except Project_Number.  Once I removed curly brackets for each individual field...

    Patch(Comments,{Project_Number: _var_projnum,Comment_Number: _var_commnum});

    It worked.  I do not know why.  Happy I can stop solving this problem though because it was becoming a total time sucker.  Thanks to all who gave ideas.

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard