Getting an ID to use in drag and drop items that need a unique ID

I have a component that is an FAQ section that uses a Bootstrap collapse. That means that each item would need a unique ID. With a MIGX this is easy since I can use [[+idx]].

Is there a way to get the unique id that Fred uses? I was thinking something like below.

<div class="accordion-item">
    <p class="accordion-header">
      <button class="accordion-button"
        type="button"
        data-fred-class="collapsed"
        data-bs-toggle="collapse"
        data-bs-target="#collapse{{ fred.id }}"
        aria-expanded="false"
        aria-controls="collapse">
        {{ question }} <i class="fa-solid fa-angle-down"></i>
      </button>
    </p>
    <div class="accordion-collapse collapse" data-bs-parent="#accordionExample" id="collapse{{ fred.id }}">
      <div class="accordion-body">{{ answer }}</div>
    </div>
</div>