dynamically set visibility of a repeater based on the value of a structured page field

Robert Srigley asked on December 6, 2019 17:12

On a Structured Page, we have a text field called ContactUs, the Form Control for this field is a Drop-down list.

The drop down list of Options is manually uploaded from values from an external data source.

The first value in the drop down list is; 0;-- Please Select Your Program/Service --

We have a repeater on a page with a Web part contol ID value of Contact411

On the Visibility area of the repater, I want to enter macro code that checks the value of the ContactUs field and if it is 0 (zero), then hide the repeater.

What syntax is required to do this?

Thank you.

Correct Answer

Brenden Kehren answered on December 6, 2019 17:15

In the Visibility set the macro like so:

{%CurrentDocument.GetValue("ContactUs").ToString() != "0"|(identity)GlobalAdministrator%}

0 votesVote for this answer Unmark Correct answer

Recent Answers


Robert Srigley answered on December 6, 2019 19:36 (last edited on December 10, 2019 02:31)

This works as well;

{% CurrentDocument.GetValue ("ContactUs") != 0 |(identity)GlobalAdministrator%}

Thank you Brenden as always for the quick response.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.