Comparing acf_user with user_field=id

I’m struggling to determine if the current user is in an acf user field while looping through posts. The acf user field can have multiple users, so I’m wondering if this is some sort of array access issue that I can’t figure out.

My sample code is below. Any suggestions would be greatly appreciated!

<Set name=curr_user>
  <Field user_field="id" />
</Set>

<Loop type=project>
  <h5><Field title /></h5>
  <Loop acf_user=repetiture_access>
      <If field=id is variable=curr_user >
          <p>User <Field id> has access</p>
      </If>
  </Loop>
</Loop>

I think it’s that the combination of field and variable is not supported. It might work by passing the value (current user ID) with the value parameter.

<If field=id is value="{Get curr_user}" >

@eliot Thanks so much! That worked!

1 Like