cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Patch formula

Hi,

 

Can someone help with what error i have in this patch formula?

 

Patch('Animal Information', {'Animal Information':'Foster Animal Form'.LastSubmit};
Refresh('Animal Information'); Navigate('Home Screen'); Notify( "Thank you for fostering a rescue animal!", NotificationType.Success)
17 REPLIES 17

Hi

 

Thank you for the formula

 

I have tried it both ways:

 

Form On Success

Patch(

    'Animal Information',

    LookUp(

        'Animal Information',

        'Animal Information' = Form1.LastSubmit.'Animal Information'

    ),

    {

        'Shelter Status': 'Shelter Status (Animal Information)'.'Claimed for Foster'

    }

)

 

Submit button - 

SubmitForm(Form1);
Navigate('Home Screen');
Notify("Thank you for applying to foster an animal!", NotificationType.Success)
 
This works on the form however doesn't update the record on the table, it still says ready to foster instead of claimed for foster.
 
I also tried it where i just have the shelter status as part of the form for the user to change this to claimed for foster and then the submit button, this also doesn't update the record.

Hi @J_Easter,

 

Go to your table in the solution window and select your columns, you will see a column with the data type unique identifier. It is usually the same name as your table but plural. So for me, my table is called Animal and the unique identifier is animals.

@Corry Thank you for that explanation. Unfortunately, I am still stuck.  I tried to follow the example you shared but with no luck.

 

Patch(
    Animal Table,
    LookUp(
        Animal Table,
        pu_animaltableid = Form1.LastSubmit.Animal Table
    ),
    {
        'Shelter Status': 'Shelter Status (Animal Table)'.'Claimed for Foster'
    }
);
Notify(
    "Form successfully submitted",
    NotificationType.Success
)

Hi

 

I have got the Submit form option to work on one of my forms, but it is not working for the Foster an Animal form. The only fields I have are Animal Name, Foster Claimer and Shelter Status. Do I have to have any other column for it to work?

HI @J_Easter,

 

I updated my table name to match your table name as this may better highlight the differences.

Here is the formula I have entered that produces no syntax errors.

 

Patch(
    'Animal Tables',
    LookUp(
        'Animal Tables',
        cr0f4_animalsid = Form2_1.LastSubmit.Animals
    ),
    {'Shelter Status': 'Shelter Status (Animal Tables)'.'Claimed for Foster'}
)
I have highlighted in red the part of your formula that needs correction. the value after LastSubmit. should be the column name (Display Name) of your unique identifier column. This is your 'Logical Name' of that column "pu_animaltableid".
 
Please also note that the patch formula is being used in the OnSuccess property of the form as the Shelter Status column is not in the form itself.
 
If the shelter status column is still in the form within your canvas app. This formula may not work as intended.

I have used this too and it is not updating the record still:

 

Patch(

    'Animal Information',

    LookUp(

        'Animal Information',

        'Animal ID' = 'Foster an Animal Form'.LastSubmit.'Animal ID'

    ),

    {

        'Shelter Status': 'Shelter Status (Animal Information)'.'Claimed for Foster'

    }

)

I have used the Submit button instead and kept the Shelter Status as a drop down on the form - Thank you @Corry  and @ZeeScience  for all your help!!!

HI @mgreen91,

 

It is really important that you are using the 'Logical Name' of your 'Unique Identifier' column and the display name of the 'Unique Identifier' column.

Here is where those 2 parts need to be in the formula I am using.

 

Unique Identifier Column

Logical Name

Display Name

 

Patch(
    'Animal Information',
    LookUp(
        'Animal Information',
        'Animal ID' = 'Foster an Animal Form'.LastSubmit.'Animal ID'
    ),
    {
        'Shelter Status': 'Shelter Status (Animal Information)'.'Claimed for Foster'
    }
)

 

This is what my Unique Identifier Column looks like.

 

Corry_0-1716375204605.png

 

To get the Logical Name, click the 3 vertical dots as shown in the below image.

 

Corry_1-1716375317084.png

Helpful resources

Announcements

Important Update | Power Up Community READ ONLY July 22 – July 28

Dear Community Members, As you may have read, the Power Platform communities are transitioning to a new platform and to access will be set to READ-ONLY mode during the transition. Key DatesTo ensure current learners have adequate support in the final week of the cohort, the Power Up Program Community will transition to READ-ONLY mode starting July 22nd, the platform will transition to READ-ONLY mode until July 28th. Power Apps, Power Automate, and Power Pages communities will be read-only July 16-22, 2024.During this period, members will not be able to start new threads or Kudo, Comment, or Reply to any posts, but will be able to search and review past threads or solutions. On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities. Learners will be able to sign in to the new Power Up Program community experience, starting July 29th. If you registered for community using your learnwithpowerup account, you will not receive an email, but should be able to sign in successfully if you are signed in to My hub.  If you need help with your community account, please submit a request at aka.ms/PPCommSupport We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead! 

Learn what to expect in the Power Up Program

Since its inception in 2022, the Power Up Program has evolved based on feedback from learners and Microsoft Partners and customers. Today's Power Up learners can expect to learn the fundamentals of Microsoft Power Platform in the accelerated seven-week, video-based Power Up Maker course.   Hear from Principal Program Manager, Dimpi Gandhi to discover the latest enhancements and meet the Microsoft MVPs, Rory Neary and Charlie Phipps, who partnered with the Microsoft Power Up Program to create the Power Up Maker course to guide learners to use the Microsoft Power Platform to develop custom applications, build dazzling report dashboards, or create efficiencies through automation.  

Welcome to the Power Up Program Community

The Power Up Program is a free upskilling program where nontechnical people can learn the fundamentals of Microsoft Power Platform. The Power Up Maker course is a seven-week self-paced virtual learning plan that include video-based objectives featuring Power Apps, Power BI and Power Automate.  As a member of the Power Up Community, you can grow your skills and build connections. You can post questions to get help with the curriculum and hands-on exercises from experts and peers in the product boards.  Check out the Community Information & Feedback board to find help or provide feedback with the community experience, and please take time to post in the Social board to tell us more about yourself. If you're new to the Power Up Program and looking for information to register. You can sign up at PowerUp.Microsoft.com.

Users online (944)