Ask Your Question
0

RETS Only getting partial city

asked 2020-03-15 11:54:59 -0500

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";

}

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-16 08:53:36 -0500

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.

edit flag offensive delete link more

Comments

That did the trick. Thank you very much.

ailchuk gravatar imageailchuk ( 2020-03-16 09:42:40 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-03-15 11:54:59 -0500

Seen: 8 times

Last updated: Mar 16