In the field shown below- since it is a link field, i want to show an error if it does not contain two backslashes "//"
And it is working fine with this formula
If((IsBlank(Find("//",DataCardValue2.Text))),"An entry is required or has an invalid value.")
The value entered here does not have 2 backslashes and so it shows an error.
The problem is that even when somebody is filling out the form, it shows out the error by default. I want it to behave like other fields which show error only if a mandatory field is blank upon submission not. Other fields have this error message-
If(Not(IsBlank(Parent.Error)),"An entry is required or has an invalid value.")
Solved! Go to Solution.
Your direction helped me achieve it- a lil differently though. I took these actions
Error Message, Text Property = If(Or(Not(IsBlank(Parent.Error)),!IsMatch(DataCardValue45.Text,"//",Contains)),"An entry is required or has an invalid value.")
Then, on Visible property of error message- i define a global variable named "gLinkError"
The variable turns true when the OnSAVE property of SP Integration form is saved without any value or without "//"- using Set(gLinkError,true)
OnNEW Property of SP Integration form is set to Set(gLinkError,false)
Thanks both again!
Set the Required property of the datacard to the following:
"//" in DataCardValue2.Text
Set the text of your error label to:
"An entry is required or has an invalid value."
Set the Visible property of the label to:
Should give you what you need.
@RandyHayes I am a tricky issue- the field's required values is dependent on the field just above it.
If i separate them by a colon- it shows an error, and can't even use AND operator between both the logics
Please advise, based on the screenshot!
Change your formula to the following:
("//" in DataCardValue2.Text) && DataCardValue40.Value
@RandyHayes Please refer the screenshot below
The field "BRD Supplement Link" should show mandatory/ required asterisk (*) if the field just above it titled "New Report/ Version" is turned "ON"- which it is by default.
With this ("//" in DataCardValue45.Text) && DataCardValue40.Value- the required asterisk appears only when both // and the field above is ON. That's not the case.
The intention is to first make the field "BRD Supplement Link" mandatory based on the field above being "ON" and then show the error if the value in BRD Supplement is either blank or not containing // (meaning link)
Am sorry for bothering again- thanks for continually helping!
Set the visible property of the asterisk label to:
@RandyHayes Thanks, asterisk is working fine. However, when i tried saving the BRD Supplement field with blank- it did not show an error on the field. This field being a link should always contain "//". And i expected an error if it does not have it!
@RandyHayes I guess this is because we artificially induced the asterisk. The error pops up for mandatory fields. And the value key doesn't consider it to be mandatory just yet.
Ah, so one other bit to add...
In the Update property of the datacard, put the following formula:
If(DataCardValue40.Value && !("//" in DataCardValue2.Text), Blank(), DataCardValue2.Text)
This will force the Update to see its value as blank if it is not valid and thus force it to be an error (based on the Required property)
@RandyHayes Unfortunately, this did not work. I'll summarize- what all i have done. Please note however, that "BRD Supplement Link" data card is DataCardValue45 and not DataCardValue2--- 2 in my original question was just mentioned as an example.
Changes made are:-
BRD Supplement Link DataCard, Update Property = If(DataCardValue40.Value && !("//" in DataCardValue45.Text), Blank(), DataCardValue45.Text)
BRD Supplement Link DataCard, Required Property = ("//" in DataCardValue45.Text) && DataCardValue40.Value
StarVisible, Visible Property = DataCardValue40.Value
Error Message, Text Property = "An entry is required or has an invalid value."
Error Message, Visible Property = !IsBlank(Parent.Error)
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.