Any tutorial on how to use the plugin? i cant find anything useful in the knowledgebase
1 Like
I think here is Active plugins and it tutorial.
I’d be happy to guide you. The main use case here is if you’re getting the value from another source and want to set the value this can do so. This was built for the use case that someone does a Pipescript call to get a specific ID using the API and then set the dropdown to that value.
Leave a comment of what you’re trying to do and I’d be happy to help guide you.
I’ve this problem I’m trying to solve and I’m not sure if the plugin will help
Here - Ive used the local storage to store the record value and i use the plugin to pick it up and set my connection, i deleted the line to auto submit and now I can use this connection field to filter.
/* START OF PLUGIN CODE FOR Set Connection Field via JS */
var companyRecordId = localStorage.getItem('company_record_id');
console.log(companyRecordId);
TB.render('component_3', function(data) {
const joinField = jQuery('#field_block_field_408 select.select2', data.ele).select2();
const values = companyRecordId .includes('[') ? JSON.parse(companyRecordId .replace(/'/g, '"')) : [companyRecordId];
values.forEach(value => {
jQuery(joinField).trigger({
type: 'select2:select',
params: { data: { id: value } }
});
});
jQuery(joinField).val(values).trigger('change.select2');
jQuery('#field_block_field_408 .select2-container', data.ele).css('width','100%');
});
/* END OF PLUGIN CODE FOR Set Connection Field via JS */