cancel
Showing results for 
Search instead for 
Did you mean: 
Carlosr

Checking for sensitive information in data

I had a question, how do I detect sensitive information in data from a canvas app?  One approach:  look for it during data entry.  Lets make this reusable!

 

To illustrate this, I created a custom component:

 

Carlosr_0-1629397397585.png

 

I added the output property like this:

 

Carlosr_1-1629397431558.png

 

Then I added a parameter named content to the property:

Carlosr_2-1629397491003.png

 

I selected the property and added this formula to it:

IsMatch(Substitute(Trim(Content), " ", ""), "(4[0-9]{12}(?:[0-9]{3})?)|((?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|(6(?:011|5[0-9]{2})[0-9]{12})|((?:2131|1800|35\d{3})\d{11})")

This regular expression is just an example, not a tried and true way to detect credit cards.  Please test, test, test before you trust anything you find on the internet!!

 

Carlosr_3-1629397605497.png

 

Now I add the custom component to the screen along with a text input and label.  I renamed my component object to "Security".

 

Carlosr_4-1629397761718.png

 

In the text value of the label, I used this formula:

Security.ContainsCreditCard(TextInput1.Text)

 

Now I run the app and add some text.  It should show false until I add something that resembles a credit card:

 

Carlosr_7-1629398073338.png

 

 

 

 

This example shows how to build reusable functions that can do things to help make applications more robust.