Below are the two url's that I require based on the if-else condition. If '
$fr-search-value is more than one word' then 'URL 1' else ' URL 2'
URL 1. https://{xxf:property('username')}:{xxf:property('passwd')}@{xxf:property('url')}/employees?type=STAFF&resultPageSize=100&names={$fr-search-value}
URL 2. https://{xxf:property('username')}:{xxf:property('passwd')}@{xxf:property('url')}/employees?type=STAFF&resultPageSize=100&first-name={$fr-search-value}&last-name={$fr-search-value}
For this to work I'm using the below resource Url which does not seem to work. Can you please let me know what am I doing wrong here?
Resource =
https://{xxf:property('username')}:{xxf:property('passwd')}@{xxf:property('url')}/employees?type=STAFF&resultPageSize=100&{if(count(for $x in tokenize($fr-search-value,'\s')) !=1) then 'first-name={(for $x in tokenize($fr-search-value,'\s') return concat('%25',$x,'%25'))}&last-name={(for $x in tokenize($fr-search-value,'\s') return concat('%25',$x,'%25'))}' else 'names={$fr-search-value}'}
Thanks