Hi Keith,
thanks for your answer ! You made clear the fact that I could move my workflow to the backend to go around the privacy rules, which is probably a good practice when working on data. But the practice seems to invalidate your saying.
I have done this.
- Created a plugin
With offers as a List of Offers in input and 2 actions run-client-side and run-server-side (code below) that intents to access offer-items.name in a loop on offer (loop on items)
- I run the actions in all those combinations on
- run-client-side in WF client side
- run-server-side in WF client side
- run-server-side in WF backend with offers passed from client
- run-server-side in WF backend with offers fetched in backend
None of the three last have worked.
Preview mode: https://dataaccesswithplugin.bubbleapps.io/version-test?debug_mode=true
Editor mode: data_access_with_plugin | Bubble Editor
Do you understand the behavior at the light of what you just said about plugin ?? Do you see any pitfall in my way of testing it ?
run-client-side:
`function(properties, context) {
result_txt = ‘’;
offers = properties.offers.get(0, properties.offers.length());
for (let idx=0; idx < offers.length; idx++){
offer = offers[idx];
items = offer.get("offer_items_list_custom_offeritems");
items_tx = (items == null)?' is null':`has a length ${items.length()} elements`
items_list = items.get(0,items.length());
result_txt += `${offer.get('name_text')} ${items_tx}. \n `
for (item_idx = 0; item_idx < items_list.length; item_idx++){
result_txt +=`\t Name of item ${item_idx}: ${items_list[item_idx].get('name_text')}`
}
result_txt += '\n \n'
}
result_element = document.getElementById('resultClientSide');
result_element.appendChild(document.createTextNode(result_txt))
}`
run-server-side
`function(properties, context) {
result_txt = ‘’;
offers = properties.offers.get(0, properties.offers.length());
for (let idx=0; idx < offers.length; idx++){
offer = offers[idx];
items = offer.get("offer_items_list_custom_offeritems");
items_tx = (items == null)?' is null':`has a length ${items.length()} elements`
items_list = items.get(0,items.length());
result_txt += `${offer.get('name_text')} ${items_tx}. \n `
for (item_idx = 0; item_idx < items_list.length; item_idx++){
result_txt +=`\t Name of item ${item_idx}: ${items_list[item_idx].get('name_text')}`
}
result_txt += '\n \n'
}
return {"result": result_txt}
}
`