cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EmilyPowerUp
Regular Visitor

Need help with Patch Formula

Hello. I am trying to create the patch formula in my form to update my gallery to show the animal shelter status, but it keeps creating a new record instead. Please help! I have tried a patch formula with and without lookup. 

 

EmilyPowerUp_0-1718924904137.png

 

EmilyPowerUp_1-1718924936006.png

 

 

On success for the form, here is my formula:

 

Patch(
    'Animal Information',
    LookUp(
        'Animal Information',
       'Microchip ID' = 'Foster Form'.LastSubmit.'Microchip ID'
    ),{'Shelter Status':'Shelter Status (Animal Information)'.'Claimed for Foster'});
Refresh('Animal Information');Navigate('Home Screen');Notify("You have successfully claimed this animal for foster",NotificationType.Success)
1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Multi Super User
Multi Super User

Hi @EmilyPowerUp ,

 

You're nearly there. As the error text suggests, you are trying to compare text with a control (in this case 'Microchip ID_DataCard1'😞

BCBuizer_0-1719261329005.png

 

To resolve the issue, there are a few things to take into account:

1. DataCards themselves don't have any values, but the do contain a control, usually called DataCardValue# that does contain the value.

2. In this case the DataCardValue control seems to be a DropDown control. To get the selected value from a DropDown control, use its' Selected property, followed by the column name of the column you want to get.

3. The name of the column may differ, depending on what formula you use in the Items property of the DropDown control. In case it directly refers a DataSource, you can use the name of the actual columns, but if it is used for a Choice type or LookUp type column, you need to use Value.

 

Combining the above, the condition in the LookUp function may look like:

'Microchip ID' = DataCardValue#.Selected.'Microchip ID'

 Please make any corrections to this, based on the above.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

8 REPLIES 8
Quwyr
Frequent Visitor

I am facing this same error as well. Appreciate if anyone could provide a solution to this.. 

Try  'Microchip ID' = "microchip ID.datacard.value" or 'Microchip ID' = "microchip ID.datacard.text"

Hi @Mikey960 , thanks for your input! unfortunately, doesn't work for me... results are still the same.

I attempted the following with no success. It also wouldn't let me add on .value or .selected text

 

EmilyPowerUp_0-1719252672838.png

 

BCBuizer
Multi Super User
Multi Super User

Hi @EmilyPowerUp ,

 

You're nearly there. As the error text suggests, you are trying to compare text with a control (in this case 'Microchip ID_DataCard1'😞

BCBuizer_0-1719261329005.png

 

To resolve the issue, there are a few things to take into account:

1. DataCards themselves don't have any values, but the do contain a control, usually called DataCardValue# that does contain the value.

2. In this case the DataCardValue control seems to be a DropDown control. To get the selected value from a DropDown control, use its' Selected property, followed by the column name of the column you want to get.

3. The name of the column may differ, depending on what formula you use in the Items property of the DropDown control. In case it directly refers a DataSource, you can use the name of the actual columns, but if it is used for a Choice type or LookUp type column, you need to use Value.

 

Combining the above, the condition in the LookUp function may look like:

'Microchip ID' = DataCardValue#.Selected.'Microchip ID'

 Please make any corrections to this, based on the above.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Thank you for your help. I used the following formula, but it just inserted another blank row to the table, instead of updating the record.

 

Patch(
    'Animal Information',
    LookUp('Animal Information',
    'Microchip ID' = Dropdown2.Selected.'Microchip ID'),
    {
        'Shelter Status': 'Shelter Status (Animal Information)'.'Claimed for Foster'
    }
);
Refresh('Animal Information');Navigate('Home Screen');Notify("You have successfully claimed this animal for foster",NotificationType.Success)
 
It looks to be saying it is blank?
 
EmilyPowerUp_0-1719266686263.png

 

For whatever reason, it wouldn't recognize the text in Microchip ID.

I updated to the Animal ID, which did populate when I hovered over and it finally worked!!

 

Thank you thank you thank you!!

final working formula:

 

Patch(
    'Animal Information',
    LookUp('Animal Information',
     cr124_animalinformationid = Dropdown3.Selected.'Animal Information'),
    {
        'Shelter Status': 'Shelter Status (Animal Information)'.'Claimed for Foster'
    }
);
Refresh('Animal Information');Navigate('Home Screen');Notify("You have successfully claimed this animal for foster",NotificationType.Success)
PoornimaAilneni
Frequent Visitor

Hi @EmilyPowerUp 

 

Can you please let me know how did you get Animal id values from a dropdown??

and cr124_animalinformationid Is this schema name of Animal ID in Dataverse??

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 (904)