<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to extract a specific value from a text?</title><link>https://community.appian.com/discussions/f/general/17911/how-to-extract-a-specific-value-from-a-text</link><description>I am getting the following text from a third party API call. I am looking to extract only the credit card number and the cardholder name from it. How can I make this happen in Appian? Is there any function that could help? 
 &amp;quot;BBVA Rewards 4000 1234 5678</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to extract a specific value from a text?</title><link>https://community.appian.com/thread/70516?ContentTypeID=1</link><pubDate>Sat, 16 Nov 2019 00:09:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8d09b829-f17a-46df-8ed6-04b449b3cada</guid><dc:creator>Simon Kiflemariam</dc:creator><description>&lt;p&gt;Also, once you extract the data (i.e card number, expiration date) using the text functions mentioned above , it is a good idea if you check the length of the card number (some sort of validation) to make sure you are always grabbing the correct digits.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to extract a specific value from a text?</title><link>https://community.appian.com/thread/70493?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 16:30:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:df0be99f-b65d-4ce8-b72e-70ffbcea5a2d</guid><dc:creator>jsalcedo28</dc:creator><description>&lt;p&gt;Awesome! That&amp;#39;s a good starting point.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to extract a specific value from a text?</title><link>https://community.appian.com/thread/70483?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 13:41:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dc11feca-4ce2-4d52-a3d2-886ac0935eb2</guid><dc:creator>Krishna Chaitanya Mallavarapu</dc:creator><description>&lt;p&gt;As mike suggested you can use code like below&amp;nbsp;&lt;/p&gt;
&lt;p&gt;load(&lt;br /&gt; local!data: split(&lt;br /&gt; &amp;quot;BBVA&lt;br /&gt;Rewards&lt;br /&gt;4000 1234 5678 9010&lt;br /&gt;12/20&lt;br /&gt;VALID&lt;br /&gt;THRU&lt;br /&gt;VISA&lt;br /&gt;JOSE MARIA SANCHEZ&amp;quot;,&lt;br /&gt; char(&lt;br /&gt; 10&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; {&lt;br /&gt; cardNumber: local!data[3],&lt;br /&gt; name: local!data[8]&lt;br /&gt; }&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to extract a specific value from a text?</title><link>https://community.appian.com/thread/70481?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 13:24:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:be19dbc8-ffc4-413e-89d7-bcb8dc742482</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Two suggestions for a start:&lt;/p&gt;
&lt;p&gt;1) if the API call will always return data in the exact same format (i.e. always the same number of lines where the same line always has the same info, line 3 = card number, etc) -- use the split() function like&amp;nbsp;&lt;em&gt;split(local!returnText, char(10))&lt;/em&gt;, which will give you an array where the credit card number is local!array[3] and the card holder name will be local!array[8] for example.&lt;/p&gt;
&lt;p&gt;2) if there might be a little bit of variability to the number of lines, but the data is at least always in the same order, you could also use the&amp;nbsp;&lt;em&gt;extract()&lt;/em&gt; function, which will let you extract, for example, everything between &amp;quot;Rewards&amp;quot; and &amp;quot;VALID&amp;quot;, or between &amp;quot;VISA&amp;quot; and the end of the string.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>