Custom Roll Parsing can handle this. I've got a few sheets in development that use a pattern like this. Using the K-scaffold 's JS library this would look like: const initiateRoll = function(event){
k.getAllAttrs({
props:['character_name'],//non repeating attributes that needed to be gotten are specified in this array.
sectionDetails:[{section:'repeating_sectionname',fields:['name']}],//The details of the repeating sections to get IDs for are defined here.
callback:async (attributes,sections)=>{//The callback function to run once all attributes have been retreived. We define this as an async function so we can await the results of startRoll and the k.extractQueryResult function
let query = sections.repeating_sectionname.reduce((text,id)=>{
let rollName = attributes[`repeating_sectionname_${id}_name`]
text.push(`${rollName},${id}`);//Push the text and id to the array of query prompts
return text;
},['Use which row'])
.join('|');//Join the created array of query info with `|`.
let selectedID = await k.extractQueryResult(query);//The k-scaffold provides this function for asking the player for input on the roll. The returned value will be the value of the option in the query that was selected (the id in this case)
let roll = await startRoll(`%{${attributes.character_name}|repeating_sectionname_${selectedID}_roll}`)
finishRoll(roll.rollId);//We aren't doing anything with this roll, so we just finish it immediately.
//The above method assumes that the roll you are calling is a regular roll button. You could also just assemble the roll based on the selected row and send it using the custom roll parsing itself.
}
});
}
on('clicked:my-button',initiateRoll);