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)
1 ACCEPTED SOLUTION

Accepted Solutions
Corry
Advocate V
Advocate V

Hi @mgreen91,

 

Are you able to confirm what it is you are trying to achieve? I.e., patching a specific column or value etc?

Based on the following:

 


@mgreen91 wrote:

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)

and your follow up post:

 

So I have set the following on the form OnSuccess variable:

Set(SignUp, 'Foster Animal Form'.LastSubmit)

And then this on the submit button:

Patch('Animal Information', {'Shelter Status':'Foster Animal Form'.LastSubmit});

Refresh('Animal Information');
Navigate('Home Screen');
Notify("Thank you for fostering a rescue animal!", NotificationType.Success)
 
I believe you are trying to patch the Shelter Status?

From my experience, unless you are setting the shelter status within your 'Foster Animal Form', you will need to look up the specific record that was last submitted and patch the shelter status. I am doing this myself in the OnSuccess property of my form.

Patch(
    Animals,
    LookUp(
        Animals,
        cr0f4_animalsid = Form2.LastSubmit.Animals
    ),
    {
        'Shelter Status': 'Shelter Status (Animals)'.'Claimed for Foster'
    }
);
Notify(
    "Form submitted successfully",
    NotificationType.Success
)
 

Here is a breakdown of the formula.

Patch(
    Table Name,
    LookUp(
        Table Name,
        Unique identifier in Table = Form Name.Last Record Submited.Unique identifier Column Name
    ),
    {
        'Shelter Status': 'Choice Column Name'.'Choice'
    }
);
Notify(
    "Form submitted successfully",
    NotificationType.Success
)
 

SubmitForm

If your Shelter Status is a drop down (ComboBox) within your canvas app form and you can select an option. You shouldn't need to use a patch function. The SubmitForm(Form Name) formula will patch all columns (fields) that are part of your form with whatever values are selected (entered).

View solution in original post

17 REPLIES 17

Patch('Animal Tables', {'Shelter Status': 'Shelter Status'.Form2.LastSubmit
It should look something like this

 

'Shelter Status' is the name of the column you want to patch (You replace it with your own column)

'Shelter Status'.Form2.LastSubmit is what it then takes from the form you submit and patches it to the Dataverse table (Form2 is the name of your own form)

Hi

 

I have updated but still have an error

 

Patch('Animal Information', {'Shelter Status':'Foster Animal Form'.LastSubmit
Refresh('Animal Information');
Navigate('Home Screen');
Notify("Thank you for fostering a rescue animal!", NotificationType.Success)
 
It says LastSubmit does not exist

Are you making sure your form is set to a variable? Do you have the OnSuccess for the form with anything like the below:

 

Set(
    Name of Variable of Choice,
    Name of Form.LastSubmit
);

So I have set the following on the form OnSuccess variable:

 

Set(SignUp, 'Foster Animal Form'.LastSubmit)

 

And then this on the submit button:

 

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

mgreen91_0-1716306858868.png

 

You did not properly close your patch function well, and also your form OnSuccess property should be where you do the setting for .LastSubmit. See my screenshot below where I used it

the picture seems too tiny

Corry
Advocate V
Advocate V

Hi @mgreen91,

 

Are you able to confirm what it is you are trying to achieve? I.e., patching a specific column or value etc?

Based on the following:

 


@mgreen91 wrote:

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)

and your follow up post:

 

So I have set the following on the form OnSuccess variable:

Set(SignUp, 'Foster Animal Form'.LastSubmit)

And then this on the submit button:

Patch('Animal Information', {'Shelter Status':'Foster Animal Form'.LastSubmit});

Refresh('Animal Information');
Navigate('Home Screen');
Notify("Thank you for fostering a rescue animal!", NotificationType.Success)
 
I believe you are trying to patch the Shelter Status?

From my experience, unless you are setting the shelter status within your 'Foster Animal Form', you will need to look up the specific record that was last submitted and patch the shelter status. I am doing this myself in the OnSuccess property of my form.

Patch(
    Animals,
    LookUp(
        Animals,
        cr0f4_animalsid = Form2.LastSubmit.Animals
    ),
    {
        'Shelter Status': 'Shelter Status (Animals)'.'Claimed for Foster'
    }
);
Notify(
    "Form submitted successfully",
    NotificationType.Success
)
 

Here is a breakdown of the formula.

Patch(
    Table Name,
    LookUp(
        Table Name,
        Unique identifier in Table = Form Name.Last Record Submited.Unique identifier Column Name
    ),
    {
        'Shelter Status': 'Choice Column Name'.'Choice'
    }
);
Notify(
    "Form submitted successfully",
    NotificationType.Success
)
 

SubmitForm

If your Shelter Status is a drop down (ComboBox) within your canvas app form and you can select an option. You shouldn't need to use a patch function. The SubmitForm(Form Name) formula will patch all columns (fields) that are part of your form with whatever values are selected (entered).

Hello Corry! Can you please explain how you identified the unique identifier?

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 (1,029)