Hello,
I am trying to trigger a SmartAction from a SmartView using React. The SmartAction is created like so:
action "Check Eligibility", type: "single", fields: [
{
field: "Facts",
type: "String",
is_required: true,
},
]
Basically, I want to take user input from a SmartView and trigger the SmartAction with that user input from within the SmartView when a user clicks a button.
I’ve tried seeing if I could pass in the data to the triggerCustomAction
method like so:
this.props.triggerCustomAction(this.props.collection, "Check Eligibility", promotionRecord, data);
Where promotionRecord
is one of the records in the collection and data
is a string (to be used as the “Facts” field required for the SmartAction).
but this doesn’t seem to work and returns false
.
I’m guessing I’m not calling this function correctly or perhaps it’s not supported yet using React? Any help would be appreciated!
Expected behavior
Doing the following will trigger the SmartAction for the current promotionRecord
:
this.props.triggerCustomAction(this.props.collection, "Check Eligibility", promotionRecord, data);
Actual behavior
No API call is made and the triggerCustomAction
method returns false
.
Failure Logs
Please include any relevant log snippets, if necessary.
Context
Please provide any relevant information about your setup.
- Package Version: forest_liana: 6.3.2
- Express Version:
- Sequelize Version:
- Database Dialect: postgres
- Database Version: > 9 (I think)