First time here? Check out the FAQ!
0

RETS Only getting partial city

  • retag add tags

Hi,

When I pull the L_City I'm only getting the first 5 characters of the city.

URL: http://gbhar-rets.paragonrels.com/ret...

Account Name: aiclhuk

Version: 1.7.2

My Test Page: http://topshelfspearfish.com/testrets...

$query = "(ListingID=0+)";

$select = 'ListingID,ListPrice,StreetNumber,StreetName,City,PostalCode,ListingStatus,Beds,Style,YearBuilt,Directions';

try {

echo "\n";

$results = $rets->Search('Property', 'RE_1', $query, ['Limit' => 1, 'Count' => 2]);

$recordCount = $results->getTotalResultsCount();

echo "Record Count: {$recordCount}\n\n";

$results = $rets->Search('Property', 'RE_1', $query,

[

'QueryType' => 'DMQL2',

'Count' => 1,

'Format' => 'COMPACT',

'Limit' => 20,

'StandardNames' => 1,

'Select' => $select,

]);

echo "Search Results:" . "\n";

foreach ($results as $r) {

echo $r['City'] . "\n";

//var_dump($r);

}

} catch (Exception $e)

{

echo "Search failed \n";

echo "Error: " . $e->getMessage() ."\n";

}

try {

$rets->Disconnect();

echo "\n";

echo "Logout" . "\n";

} catch (Exception $e)

{

echo "Logout failed\n";

echo "Error: " . $e->getMessage() . "\n";

}

ailchuk's avatar
ailchuk
asked 2020-03-15 11:54:59 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

When you pull data in COMPACT format it returns the "Value" for the field when a lookup is attached.
This can be a numeric value or abbreviated code.
You can use this value with the lookup data to translate it to the lookup's "LongValue"
Or you can change 'Format' => 'COMPACT' to 'Format' => 'COMPACT-DECODED'.
Which automatically does this on output.

bwolven's avatar
bwolven
answered 2020-03-16 08:53:36 -0500
edit flag offensive 0 remove flag delete link

Comments

That did the trick. Thank you very much.

ailchuk's avatar ailchuk (2020-03-16 09:42:40 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer