0 votes
in Rock by KateQuinn (6.8k points)
edited

Client: Central in Mesa, AZ

Task: https://app.asana.com/0/1202285749307812/1206189795783871/f

I have group attributes that I wish to keep from displaying publicly, so I unchecked the 'Public' option on the attribute in the group type. Then I altered the lava to only display public attribute value.

This works well, except that for some people, the 'Public' value seems to change - which is impossible, because 'IsPublic' is a field in the database on the attribute record. It doesn't change. Nevertheless, when I impersonate this person, the lava value for 'IsPublic' changes from 'false' to 'true':

Zach Davies: https://rock.centralaz.com/Person/164749

Copied Grp Toolbox page w/Test Group: https://rock.centralaz.com/page/2566?GroupId=702314

Lava Screenshot:

enter image description here

Normal Display:

enter image description here

Abnormal Display:

enter image description here

1 Answer

+2 votes
by MarkLee (8.3k points)
edited
 
Best answer
{% attribute id:'{{ attributeValue.AttributeId }}' %}
    {% assign public = attribute.IsPublic %}
{% endattribute %}

The attribute entity command isn't guaranteed to return a value. If no value is returned public will not be reassigned. Lava doesn't support scoped variables so the previous value is retained.

I suspect that the entity command is ignoring these values because the are marked IsPublic:false. Adding securityenabled:'false' to the entity command bypasses this check and fixes the issue.

{% attribute id:'{{ attributeValue.AttributeId }}' securityenabled:'false' %}
    {% assign public = attribute.IsPublic %}
{% endattribute %}
Welcome! Here you can ask questions and receive answers (hopefully) from other members of our team.
...