When you select an array for a partial update - you get field options for INDEX, PATH & VALUE.
When you select an object for a partial update - you get field options for PATH & VALUE.
So, if you want to update an item in an array WITHIN an object - you need to resort to custom javascript.
What would be the IDEAL no-code approach??
When you select an object as the variable - WeWeb checks to see if there is an array(s) within the object - and if there is - it give you a field to bind / define the ARRAY (within the object) - followed by the INDEX, PATH & VALUE
Further - this ARRAY field could be OPTIONAL so user could still target a value in the object that is not in an array if the object contains both value outside of arrays and within arrays in the root of the object.
I donât quite understand all of your question. But looking at: So, if you want to update an item in an array WITHIN an object - you need to resort to custom javascript.
I would take a look at the Weweb object and array formulas.
For example:
Fetch the array in the object: getKeyValue
Find the index of the array item you want: findIndexByKey
Update item: Partly update array using the found index
It wasnât really a question - more of a UI suggestion so that doing a partial update to an array (remove one item at a specific index, etc) that is within an Object - could be super simple and more intuitive -
Here is little mockup I made - so, IF the object contains an array(s) - you can select them from a drop down and target.
Of course you can ultimately do pretty much ANYTHING with formulas and custom JS - but WeWeb as a product is a nocode front end EDITOR - so IMO - WeWeb should always be working to make things EASIER in the editor.
This subject has already be discussed and I understand the need. Itâs not that easy UX wise because the variable is not always filled when youâre editing it. And the sub property
could also be sometimes null, sometimes an array. We can detect it on a weweb variable because they are typed, itâs more complicated and confusing in term of UX when the property type can change depending of when you are editing it
Understood re: ânot that easyâ - I just find the current Action > âChange a variable valueâ to be super easy for updating a simple object or array - but then itâs a show stopper when when you want to quickly do partial updates on arrays within objects. (unless I am missing something and someone wants to show me the âeasy wayâ).
I am pretty sure you guys could come up with a clever UX solution - even if it means having a different, separate Action "âChange a variable value - advancedâ that is more focused on this use case - if you want to preserve the current UI/UX of âChange a variable valueâ
Well that would would be WAY less painful than right now! And you should fast track that if you can for sure.
But, obviously an elegant, simple nocode UI/UX for this would be a great feature IMO. One of the reasons I love XANO so much is that their SET & GET filters are very simple for facilitating manipulating / updating variable objects - regardless of complexity - easy and fast.