Just getting started with WeWeb after putting a fair bit of time into getting my backend functionality working with XANO.
Couple of issues I ran into whilst playing around this morning.
1) Number formatting (or custom formulas) in Data Tables -
Have been trying to format the output on one of the columns in the data table so that it shows as a % rather than a raw decimal, so set it to type ‘custom’ and put in a formula.
The ‘current value’ in the formula comes up with the right figure, but then nothing appears in the data table itself, listing as ‘empty list’
2) Displaying all values from an object in a table form
I’m looking to display the full set of contract parameters on a page (view only on this page, but ability to edit in same structure on a separate page). Created a variable containing the object I’m bringing back and was hoping just to display that as a table with the keys in column A and values in column B (and ‘edit value’ button in the future next to each value)
What would be the easiest way of doing this with WeWeb? Realise I can create two text boxes and type in they key for the first, link to the value for the second and repeat this 20 times manually, but guessing there’s an easier way of achieving this
You need to now use that array (which you converted) as the list of items for the data grid.
If you are going to do the conversion as part of a workflow, then you will want to bind the results of the conversion to a variable, and then use that variable as the collection list.
Create a variable called something like array_to_display
On that javascript action step, change it to “Change variable Value” and select “array_to_display” as the variable
Click on the bind/plug button next to new value
Click on Javascript in dropdown top left of new popup window
paste your code after the word return
Now, you have taken your object, converted it into an array, and returned that value to the variable called “array_to_display” so, you can use that variable as a collection list:
This will now display the results of that conversion in the data table.
One note: that javascript has some compatibility issue with earlier versions of IE primarily. IF your users are using IE, we may want to use different javascript to convert object to array.
In your first picture you are binding the value of the item of the flexbox of the cell. In this way you are trying to create a list inside every cell but the formula is returning a string, so weweb complains that the binding is an empty list.
Try this:
you have your column in the datagrid set to custom element