Hi everyone I am trying to create a new record with the function patch, but I think is not working correctly, I would like to know if someone can help me with this, I am creating a new record with the formula "if", with the values that the user writes in the cards from a form. I don´t know if I can do this.
I am trying to create this record so I can save the date in an excel table, like the one it show below this.
Does Anyone know how can I fix this, or with function I can use, to save the new record I am creating.
Hi @Anonymous ,
In the LookUp, you need to pass the datasource and the condition to match the row in your excel, like get data where column "Batch" value is equal to Value from form.
You can refer to this: Filter, Search, and LookUp functions in Power Apps (contains video) - Power Apps | Microsoft Docs
Regards,
Shaik Sha
Hi @Mister_Shaik, I am having problems with your comment, I don´t know how to implement the part of code in the app, could u help, with a little more of detail of how. Right now I have this, I dont know if I am correct.
Hi @Anonymous ,
When you're using a patch function, the second parameter defines if you want to update an item or create an item,
If you use "Defaults(#DataSource)" it will create a new entry into the data source.
Patch(PruebaFinal3; Defaults(PruebaFinal3); {Column:value...})
If you use "LookUp(#DataSource, Batch eq #BatchDataCardValue)"
Patch(PruebaFinal3; LookUp(PruebaFinal3; Batch eq #DataCardValueForBatch); {Column:value...})
Let me know if you're able to update it
Kind Regards,
Shaik Sha
I already resolved this, thanks for the help, but now I am with another issue, power apps is creating me a new record entry. I want to save the entry but in the row of batch.1 not in another one.
Hi @Anonymous ,
Can you provide the screenshot of the error message, by hovering over your formula?
Also, can you try enclosing your formulas in a Value() function to convert them to numbers when you're trying to do numerical operations.
(Value(DataCardValue154_2.Text) * 320 / 148 * (1 + Value(DataCardValue155_2.Text)/100)) - Value(DataCardValue157_2.Text)
Kind Regards,
Shaik Sha
________________________________________________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2