
456 N.W.2d 367 (1990)
Anthony Mark DIDONATO, Appellant,
v.
IOWA DEPARTMENT OF TRANSPORTATION, MOTOR VEHICLE DIVISION, Appellee.
No. 89-1042.
Supreme Court of Iowa.
May 23, 1990.
*368 Dennis P. Ogden, Des Moines, for appellant.
Thomas J. Miller, Atty. Gen., Charles J. Krogmeier, Deputy Atty. Gen., and Mark Hunacek, Asst. Atty. Gen., for appellee.
Considered by LARSON, P.J., and LAVORATO, NEUMAN, SNELL, and ANDREASEN, JJ.
SNELL, Justice.
Anthony Mark Didonato appeals suspension of his Iowa driver's license and vehicle registration pursuant to Iowa Code sections 321J.12 and 321A.17 (1987). He claims he was denied the opportunity to place a telephone call pursuant to Iowa Code section 804.20 (1987) prior to signing an implied consent form. At approximately 2:25 a.m. on July 3, 1988, Didonato was arrested and cited for first-offense operating while intoxicated. After being transported to the police station, Didonato demanded to place a telephone call, but was denied the opportunity while the arresting officer filled out an implied consent form.
Didonato's continued demands to place a telephone call led to a scuffle, after which Didonato signed the form and was requested to provide a urine sample for testing. He had difficulty in providing the specimen, and in the interlude between the request and provision of the sample was allowed to make a telephone call to his sister, who is an attorney.
The department of transportation revoked Didonato's license, on the basis that the urine test result showed a blood alcohol content of .10% or more. See Iowa Code § 321J.2 (1987 Supp.). Didonato requested a hearing, claiming that the failure to provide him with a telephone call prior to requiring his signature on the implied consent form was a violation of his limited statutory right to counsel pursuant to Iowa Code section 804.20 (1987). See State v. Vietor, 261 N.W.2d 828, 832 (Iowa 1978). The hearing officer found that Didonato had in fact asked to call a friend, rather than making a general request for a telephone call, and that he had in any event been allowed to make a telephone call to someone with the same last name prior to undergoing the chemical test. The hearing *369 officer concluded that section 804.20 does not require arresting officers to grant requests for telephone calls to friends and upheld the revocation. Didonato appealed to the district court, which upheld the suspension on the same grounds cited by the hearing officer. He now appeals to this court, and we affirm.
A court reviewing agency action shall grant appropriate relief if substantial rights of the appellant have been prejudiced under the standards enumerated in Iowa Code section 17A.19(8). Aluminum Co. of America v. Employment Appeal Bd., 449 N.W.2d 391, 393-94 (Iowa 1989). If the agency's action is supported by substantial evidence when the record is viewed as a whole, and is not affected by errors of law, we must affirm the decision. Id.

I. Application of Section 804.20 to Chapter 321J.

The State argues that since Didonato elected to take the test rather than to refuse to take it, the administrative penalty imposed is the most lenient he could have obtained. It contends that the limited statutory right to counsel granted by section 804.20 is not applicable in the context of this violation of chapter 321J.
Our cases have held that there is a limited right to counsel pursuant to section 804.20 for persons confronting application of the implied consent provisions of chapter 321J. See, e.g., Vietor, 261 N.W.2d at 832. The State points out that many of these cases involve individuals who refused to take a chemical test after being denied counsel. See Ferguson v. State, Dep't of Transp., Motor Vehicle Div., 424 N.W.2d 464 (Iowa 1988); Fuller v. Dep't of Transp., 275 N.W.2d 410 (Iowa 1979); State v. Vietor, 261 N.W.2d 828 (Iowa 1978). The State reasons that in those cases rescission of the revocation was proper because the individuals involved were prejudiced by the denial of counsel, since the administrative penalties for refusal are greater than those for failing the test. Iowa Code § 321J.9 (1987). The license revocation period is 240 days if a person refuses to submit to a chemical test, whereas the period is 180 days if the person submits to the test and the result shows an alcohol concentration of .10% or more. The advice of counsel, the State argues, may have resulted in a sounder decision with less harsh results. By way of contrast, the State contends, an individual who chooses to consent to chemical testing faces the lesser of the two administrative penalties, and as a result is not prejudiced by denial of his or her statutory right to counsel.
This argument raises the question of whether violation of the limited statutory right to counsel requires exclusion of the evidence obtained within the context of a license revocation proceeding. In Manders v. Iowa Department of Transportation, 454 N.W.2d 364 (Iowa 1990), we recently decided that there are no provisions in the several statutes comprising the implied consent law itself that suggest any basis for imposition of a statutory exclusionary rule in the context of administrative proceedings absent adjudication in a related criminal proceeding. Id. at 366.
The provisions of section 804.20, however, are broadly applicable, although not directly related to the license suspension provisions of chapter 321J. This court has ruled that section 804.20 grants a limited right to consult with counsel in a criminal context. Vietor, 261 N.W.2d at 832. We have also held that the limited right to counsel adopted by Vietor is applicable to department of transportation revocation proceedings. Ferguson, 424 N.W.2d at 466; Fuller, 275 N.W.2d at 411. Fuller establishes the principle that the exclusionary rule adopted in the context of criminal cases is fully applicable to license revocation proceedings based on a refusal to submit to a chemical test.

II. Mandatory or Directory Statute Permitting Phone Call.

Iowa Code section 804.20 imposes a duty upon police officers to allow a person in custody to telephone a family member or attorney without unnecessary delay after arrival at the place of detention. The statutory mandate is that the officer shall allow the requested telephone call. In drafting *370 the interpretive provisions of our Code, the legislature has determined that, "The word `shall' imposes a duty." Iowa Code § 4.1(36)(a) (1987).
In the context of administrative proceedings related to license revocations under chapter 321J, however, this court has determined that the duty imposed may be either "directory" or "mandatory." Taylor v. Department of Transp., 260 N.W.2d 521, 522 (Iowa 1977). The dichotomy between a mandatory and a directory statute relates to whether a failure to perform the duty will have the effect of invalidating the governmental action that the requirement affects. Id. at 523.
In determining whether a statute is directory or mandatory, we look to the purpose the statute was designed to serve. See Downing v. Iowa Dep't of Transp., 415 N.W.2d 625, 628 (Iowa 1987). When the duty imposed is not essential to the main statutory objective, the provision is directory and failure to perform the duty will not affect the validity of subsequent proceedings unless prejudice is shown. Id. When the duty imposed by the provision is essential to effect the main purpose of the statute, however, the provision is mandatory, and failure to perform the duty will invalidate subsequent proceedings. Id.
The State contends that the duty imposed by section 804.20 is directory. It bases this contention upon our application of the principles just cited to determine that the main statutory objective of chapter 321J is to remove dangerous, legally intoxicated drivers from the state's highways. Id. at 628. Since the duty to provide an attorney is not consistent with the main purpose of chapter 321J, it concludes, the duty is directory in the absence of a demonstration of prejudice.
The State's argument, however, focuses upon the wrong statute. In order to determine whether the duty imposed by section 804.20 is mandatory or directory, we must look to the main purpose of that statute. The main purpose behind enactment of section 804.20 is apparent on the face of the statute. It is to provide an individual arrested the opportunity to consult with counsel or a family member after he or she has been arrested. We have held that this statutory right is available in the context of our implied consent law, subject to certain limitations. See State v. Vietor, 261 N.W.2d 828, 831-32 (Iowa 1978). Hence, the duty to provide the opportunity to make that call is mandatory. An individual who is refused this right, upon proper request, is under no obligation to show that prejudice resulted in order to challenge a driver's license revocation.

III. Statutory Right to Counsel.

The basis for Didonato's claim that his limited statutory right to counsel was violated lies in the police officer's refusal to let him make the requested telephone call prior to signing the implied consent form. The State claims, and the hearing officer found, that Didonato's request was for a telephone call to a friend, rather than an attorney or a family member. The State argues that there is no requirement that an officer allow a telephone call to a friend pursuant to Iowa Code section 804.20.
Section 804.20 provides in relevant part:
Any peace officer or other person having custody of any person arrested or restrained of the person's liberty for any reason whatever, shall permit that person, without unnecessary delay after arrival at the place of detention, to call, consult, and see a member of the person's family or an attorney of the person's choice, or both.... If a call is made, it shall be made in the presence of the person having custody of the one arrested or restrained. If such person is intoxicated, or a person under eighteen years of age, the call may be made by the person having custody.
An arrested person must thus be permitted to make a telephone call to an attorney or family member upon request, when charged with a violation of chapter 321J, subject to the limitations enumerated in Vietor, 261 N.W.2d at 832. In these circumstances, the officer or other person *371 having custody may place the call for the arrested person.
We have held, however, that the statute does not require an officer to tell an arrested person that he has a right to counsel. State v. Meissner, 315 N.W.2d 738 (Iowa 1982); State v. Vietor, 261 N.W.2d 828, 831 (Iowa 1978). But when a request to make a phone call is made we do not believe the statutory purpose is met if the officer stands mute and refuses the request. Nor would there be any difference if the request is to call a friend. In these circumstances the statute is implicated and the officer should then advise for what purpose a phone call is permitted under the statute. If the individual still wants to make a phone call, subject to the limitations announced in Vietor, 261 N.W.2d at 832, the officer must allow the call, or place it for the arrested individual pursuant to the terms of section 804.20.
The record before the hearing officer shows by substantial evidence that a request to make a phone call was made by Didonato before he signed the implied consent form. Although not made prior to signing the form, the hearing officer found that Didonato was eventually allowed to make a telephone call to an individual who had the same surname prior to providing the specimen for chemical testing. The record shows that this individual was his sister, who is an attorney. Didonato claims that the duty to allow a telephone call imposed by section 804.20 requires that the call be granted prior to the point in time when an individual must decide whether to sign the implied consent form. In the context of an arrest for violating the provisions of chapter 321J, a signature on the implied consent form does not constitute a final decision, since an individual is still free to revoke his assent to chemical testing. When the requested telephone call is permitted subsequent to signing the form, and the individual involved has an actual opportunity to consult with counsel or a family member before submitting to the chemical test, the purposes behind the statute are served. The duty imposed by the statute has also been fulfilled. The hearing officer's finding in this regard is substantiated, conforms with this legal principle and shows that Didonato has suffered no legal prejudice from the fact his phone call was made after he signed the implied consent form. We affirm the decision of the administrative hearing agency.
AFFIRMED.
