BASH variables in SFDX breaking dot notation in queries

With the most recent update to SFDX CLI, I’ve noticed that my queries that use dot notation in the select now retrieve null for dot notation columns if I use a bash variable. It’s really quite annoying. Anybody else seeing this issue or have a workaround?

Example:

#!/bin/bash
#set a variable
startdate=`sfdx force:data:soql:query -q "Select createddate from SetupAuditTrail order by createddate desc limit 1" -r csv | tail -n +2` 
#query using that variable
sfdx force:data:soql:query -q "Select id,lastmodifiedby.name from apexclass where lastmodifieddate>$startdate"

It actually works, renders the variable correctly, you get the right rows. But the dot notation column is returned as null. Do the same query again without the variable and it works just fine.

Answer

Attribution
Source : Link , Question Author : Patrick Watkins , Answer Author : Community

Leave a Comment