79740252

Date: 2025-08-19 18:01:39
Score: 0.5
Natty:
Report link

Update:

This is the right syntax for the return which will tell the value of the parameter:

e.commonEventObject.parameters

And correct syntax for the function:

function buildCategoryCardV2(categories) {
  const buttons = categories.map(category => ({
    text: category,
    onClick: {
      action: {
        "function": "handleCardClick",
        "parameters": [
        // Pass the variable's value as a parameter
        { "key": "categoryPressed", "value": category } 
      ]
      }
    }
  }));
  const card = {
    cardId: 'category_selector',
    card: {
      name: 'Category Selector',
      header: { title: 'Inventory Request', subtitle: 'Please select a category' },
      sections: [{ widgets: [{ buttonList: { buttons: buttons } }] }]
    }
  };
  return card;
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: kiev_ghetto