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

Canvas App : Button - Claimed for foster

Hi ,

 

I am not sure if I understand the requirements for the canvas app correctly.

So from my understanding we have to

  1. create a list with all the shelters and when selecting a shelter, we see the associated animals that are ready to foster.
  2. when then selecting one of those animals with shelter status "ready to foster", we should be able to enter foster name, foster date and integrate a button that changes the shelter status from "ready to foster" to "claimed for foster" , correctly?

 

how can you do this using a button and not a edit form with the choice field where you theoretically could choose all shelter status? using a button requires a cloud flow in the background to change the shelter status , am I correct?

 

but this cloud flow is not required, only the email sending cloud flow is in the requirement.

 

can anyone help how you did this?

 

thank you a lot!!

 

1 ACCEPTED SOLUTION

Accepted Solutions

@evahas @mcofuzor @simmo69lol  thanks a lot for your support.

I finally have my patch formula working and the EditForm as well as the shelter-status "claimed for foster" is working! woop wooop! sooo excited! 🙂

 

I finally got it by the advice of @Corry ! (many many thanks)

https://powerusers.microsoft.com/t5/Power-Up-Final-Challenge/THE-PATCH-FUNCTION-KEEPS-GIVING-ME-DIFF... 

 

I used the formula:

Patch(
    Animals,
    LookUp(
        Animals,
        Animals = FosterFormAnimal.LastSubmit.Animals
    ),
    {'Shelter Status': 'Shelter Status (Animals)'.'Claimed for Foster'}
);
Refresh(Animals);Navigate(StartScreen);Notify("you have succesfully fostered the animal",NotificationType.Success);
SubmitForm(FosterFormAnimal)
 
The green highlighted part navigates back to the HomeScreen once submit the form.

View solution in original post

8 REPLIES 8
simmo69lol
Frequent Visitor

Howdy

To change the table with the button you can use the "Patch" function rather than a cloud flow.

The patch function can add in the fields on the form to your table & change the shelter status.

If you have any questions feel free to ask

Patch function - Power Platform | Microsoft Learn

Thank you @simmo69lol 

I am struggling now with the patch formula.

I created a screen where you land when selecting the animal from the list.

then I added a editForm with the fields

"date for foster" and "foster Claimer".

when clicking on the button I now want to add this information PLUS set the shelter status to "claimed for foster".

 

how does this work?

i tried different patch formulas but always have an error message. see image of form.

simmo69lol
Frequent Visitor

The Patch formula can be tricky to get right. I approached it differently, allowing the foster family to enter their details and create a new row in the Foster Family Information table instead of looking up existing ones.

(I noticed there were duplicate Foster Families with different FF numbers in the data.)

Here’s what I did with it, which might help:

Set(RecordResult, Patch('Foster Family Information Tables', Defaults('Foster Family Information Tables'),
{
Name: DataCardValue10_1.Value,
FosterClaimerName: DataCardValue10_1.Value,
FosterLocation: DataCardValue12_1.Value,
LocalShelter: LocationSelected,
JoinDate: Today(),
Email: DataCardValue1.Value
}
));

Patch('Animal Tables', Gallery1.Selected,
{
'Shelter Status': 'Shelter Status'.'Claimed for Foster',
'Foster Claimer': RecordResult.FosterID
});

To break it down:

  • The first Patch creates a new row in the Foster Family Information table based on the information entered in the form.
  • The second Patch updates the Animal Tables to 'Claimed for Foster' and adds the FosterID to that animal.

The Set(RecordResult, is used to save the row information created in the first Patch so I can use the FosterID in the second Patch since it’s an autonumber generated. It’s not necessary, but variables can be quite handy.
Understand variables in canvas apps - Power Apps | Microsoft Learn



simmo69lol
Frequent Visitor

If you post an image of your formula and the error might be able to help

{
'Shelter Status': 'Shelter Status'.'Claimed for Foster',
'Foster Claimer': RecordResult.FosterID
});

 

The foster claimer is  a lookup, so patch is not working because its a different data type with RecordResult.FosterID. Did it work for you?

@mcofuzor @simmo69lol thanks guys for your help.

 

Well , I want to submit the 2 fields of the editform (date of foster and foster claimer) as well as the shelter status = claimed to foster, but this field I have not included in the editform but should be transmitted when submitting the edit form submission.

 

The datasource of the editform is "animals" and the Thitsistem ist "accountVal", because I am referring from a  gallery to this editform. I want to submit the changes of the editform of this given animal and also the shelter status.  So I would enter the formula in the editform (FosterFormAnimal) in OnSelect:

 

Patch(Animals,{Animals:'FosterFormAnimal'.LastSubmit});
Patch(Animals,'Shelter Status (Animals)'.'Claimed for Foster');
Refresh(Animals);Navigate('StartScreen');Notify("you have succesfully fostered an animal",NotificationType.Success)

 

elyne_0-1720897862958.png

maybe I am totally wrong with this formula but I don't know how to do it.

can you help me? 🙂

evahas
Advocate II
Advocate II

It looks like you might be missing the record that is being updated in your patch formula,

 

This is what worked for me: Patch(  Animals,    FosterMe, {FosterLookupCol: FormFosterFam.LastSubmit})

 
FosterMe is a variable that I set that refers to the record that needed the update.

@evahas @mcofuzor @simmo69lol  thanks a lot for your support.

I finally have my patch formula working and the EditForm as well as the shelter-status "claimed for foster" is working! woop wooop! sooo excited! 🙂

 

I finally got it by the advice of @Corry ! (many many thanks)

https://powerusers.microsoft.com/t5/Power-Up-Final-Challenge/THE-PATCH-FUNCTION-KEEPS-GIVING-ME-DIFF... 

 

I used the formula:

Patch(
    Animals,
    LookUp(
        Animals,
        Animals = FosterFormAnimal.LastSubmit.Animals
    ),
    {'Shelter Status': 'Shelter Status (Animals)'.'Claimed for Foster'}
);
Refresh(Animals);Navigate(StartScreen);Notify("you have succesfully fostered the animal",NotificationType.Success);
SubmitForm(FosterFormAnimal)
 
The green highlighted part navigates back to the HomeScreen once submit the form.

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,014)