function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hattihatti 

Help with querying a hyperlink formula field

Hi,

I have a hyperlink formula field("www.salesforce.com","Click here") and field name is Link__c. when i query this field through system.debug or api, i get the value as ' <a href="www.salesforce.com" target=""/>Click here</a> ' . Can anyone help me in querying only for 'www.salesforce.com'.

Navatar_DbSupNavatar_DbSup

Hi,

 

Use the below code snippet as reference:

 

contact[] a=[select name, link2__c from contact limit 1];

system.debug('@@@@@@@@@@@@@@@@@@@@'+a);

list<string>p=a[0].link2__c.split(' ');

system.debug('!!!!!!!!!!!!!'+p);

list<string>finalurl=p[1].split('"');

system.debug('^^^^^^^^^^^^^^^^'+finalurl[1]);

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

hattihatti

Hi,

     Thanks for the repsonse. Since this query happens across different platforms via api. I wanted to know if there is a way directly in the query to achieve the same.