Hello community!
I need help with the following: I have this formula in the record saving icon:
If (IsBlank (DateValue1_1); UpdateContext ({Enter_Date: true}); If (IsBlank (DataCardValue6_1); UpdateContext ({Enter_Hours: true}); If (DateValue1_1 exactin App_Hours.Date; UpdateContext ({No_Repeat_Dates: true}); SubmitForm (EditForm1) && Navigate ('Registry Update'; Fade))))
This formula evaluates several things in order to restrict incorrect data entry. This part of the code in particular: "If (DateValue1_1 exactin App_Hours.Date; UpdateContext ({No_Repeat_Dates: true});" evaluates whether a record already exists on that date and, if there is, prevents another record from being made on that date date, since by date the idea was that only one record can be entered. The problem is that now they have asked me to add a list field, being that now there can be several records per day, only that each record must correspond to only one status. Ex: For 01/01/2021 there may be a record with the status "Available", another with the status "Not available", etc. But what cannot be is the same day, have two equal states. How could I add that restriction? Thanks in advance!
Your formula has some errors to it.
1 - you are referencing things like DataCardValue1_1. This is a control...it is not a property. You need to reference the property of that control that you would like to determine if it is blank. So, if it is a TextInput for example, then IsBlank(DataCardValue1_1.Text) is what you need to use.
2 - same applies to the DateValue1_1...it is a control, you need to reference the actual property of the control which would be - DateValue1_1.SelectedDate
I hope this is helpful for you.
Thank you very much for the advice ! I will take them into account for a better performance of my App, but the truth is that the code is working correctly. My problem is that I don't know how to compare the date with each state now. Something like:
"If (DateValue1_1 exactin App_Hours.Date && DataCardValue6.Text exactin App_Hours.Process Type =" Prepared Guides "; UpdateContext ({No_Repeat_Dates: true});"
Although this formula does not work, what you should do is look in the date field if there is a record with that date, if there is, it looks for if there is a record with that status on that date, and if both conditions are met, it does not leave have the user add the record. I hope my problem has been understood a little better. In advance, thank you very much for your help and interest "
Can you tell me more about that the context variables are for?
Also, what kind of column is Process? You are now showing that in the formula where before you were looking at the Fecha (date) column for your comparison. You need to match types properly in the formulas. If you want to match for dates, then you need to use dates and not text.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
181 | |
52 | |
41 | |
40 | |
34 |
User | Count |
---|---|
262 | |
81 | |
71 | |
69 | |
66 |