Hi guys, i have one question about business rules on entities. I need to Patch some data using canvas app OnSelect property that have some required fields, but have a scenario when the user isn't need to populate this fields.
In my entity table I have this fields as required, so when the canvas try to Patch will appears required error message, okay ...
My question is: Can I create business rules to "When a field is set with 'Yes' option, the required field of the field is removed"?
I tried to do some like this but nothing changes in canvas app.
*Im using Defaults entity to Patch the data, if helps in something ...
Solved! Go to Solution.
@Pinguito the answer is very simple. Business Rules are not supported in Canvas Apps. Recently I had a conversation about this with someone from MS who confirmed it.
@Pinguito the answer is very simple. Business Rules are not supported in Canvas Apps. Recently I had a conversation about this with someone from MS who confirmed it.
Do you know other way? I didnt want make them optional
I can't see a way around making it optional in the data source, then use fx formulas to control the behaviour in the app.
On the screen.onVisible put
Set(_Validated,true)
Do something with the border formatting of the text box like
// Black if validated, red if not
If(
_Validated,
RGBA(0,0,0,1),
RGBA(255,0,0,1)
)
On the 'submit' button put something like
If(
IsBlank(TextBox.Text) && (whatever your other requirement is),
Set(_Validated,false);
Notify("You have not completed the text box",Warning),
Patch(Data Source, Defaults(Data Source), {table content})
)
I have to say though, if it's a Yes/No field which is set to Yes, I don't see the value in making it non-mandatory. The Yes you've entered will meet the requirement. Unless you mean "field a is required unless field b is Yes"?
Nick
Hi @nickellis74 , thanks for your reply.
In canvas app its okay, I have made all necessary validated to make sure the data. I'm not worry about this.
My curious was about the back-end, if was possible to do something like this.
Thank very much (:
@Pinguito You can use Calculated and Rollup to do some server side logic. For example, you have a Date of Birth field and an Age field, you can calculate the Age based on the Date of Birth.
The other way to do validations within Canvas App Forms is to use the Valid function.
Also, you can use the Match function to validate the format of certain fields. For example you can check if the user has entered a valid email address etc.,
Hope this helps!
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 |
---|---|
182 | |
47 | |
46 | |
34 | |
33 |
User | Count |
---|---|
260 | |
87 | |
79 | |
68 | |
67 |