Editing JSON data with a nested list

Help us help you!

If you’re stuck on a problem, please include screenshots or a short video showing:

  • What you’re trying to achieve
    I am building against an API that returns a JSON object (let’s call it a ‘deal’). Each ‘deal’ can contain a list of line items. I want to build a form that will allow me to display the project details as well as the project’s line items. This is supposed to be an edit form that allows editing the information before sending it back to the backend for an update.
  • How things are set up
    I have a landing screen that shows a list of the ‘deal’ objects from the API. I used a grid to display the top deal level attributes in the grid. The grid has an onrowclicked workflow that sets an app variable to the selected row and navigates to the deal detail form. The project details page has two sections. One shows the high level deal details such as name, value etc and then there is a repeating container that is linked to the line item details from the deal.
    The form correctly displays the values. But I have a few things to ask:
  • Is it the correct approach?
  • The repeating form element has a date attribute that I have linked to a date picker. The date picker seems to be readonly for some reason and also does not show a calendar icon to tell the user this is a date field
  • I have noticed that when I change any value on the line item details repeating item panel, a new variable is added by the front end to the JSON data structure instead of using the same attribute that it is bound to. E.g. the Coupon Frequency field is linked to ‘PaymentFrequency’ in the JSON but when I change it in preview, a new attribute ‘couponFrequency’ is added. I cannot figure out why this is so?
  • The steps to reproduce the issue
    As noted above, I will like to allow the user to edit the selected object, including the nested structures, on a details form and retain the same structure as when I bind the variables to the UI elements. Will then need to push this back to the API using POST but that will work when the data binding is correct.
  • What you’ve already tried
    Documentation is light on this. And although I am more comfortable with JS code than low-code, I will not like to use JS coding to forcefully write each attribute to its correct attribute.

Will appreciate any pointers.

Hi Debugz and welcome to the community :waving_hand:

The only way to work directly with json would be to edit the entire object and send it back, so it’s not really efficient but can be done.

The best way to handle this would be to have an external database and link each item to a column.

We’ve had a couple of users mentioning something similar:

Hope this helps!

Thanks for your response. I will see if I can influence the API results as initially I wanted to put up a frontend quickly using the existing structure of the API.

Can you elaborate on the issues I am facing?

  • The repeating form element has a date attribute that I have linked to a date picker. The date picker seems to be readonly for some reason and also does not show a calendar icon to tell the user this is a date field

  • I have noticed that when I change any value on the line item details repeating item panel, a new variable is added by the front end to the JSON data structure instead of using the same attribute that it is bound to. E.g. the Coupon Frequency field is linked to ‘PaymentFrequency’ in the JSON but when I change it in preview, a new attribute ‘couponFrequency’ is added. I cannot figure out why this is so?
    image
    image

Any update on the issues highlighted above?

hi,

can you show your “coupon frequency” input field “on change” workflow?

Hi Batik,

I fixed that by removing some incorrect code generated by AI. Thanks.

But I do still have the date issue that I need help with. I am at my wits end as to how to link date attribute in my data variable to a date picker. The date picker remains disabled. I have also tried using the Date and Time Picker but that does not allow changing the value (clicking a different date does not work and the date remains stuck at the value).

not sure I understood your setup right, but tried to recreate something similar with repeated items and it worked. Is on the video the behavior you want to achieve?

When you change the date picker value for the first time its UI doesn’t respond, because nothing is bound to date picker inside my JSON (initially there’s no date object). If you prepare proper JSON it will work without this flaw.

It is somewhat similar though I am not using a row. I have a collapsing panel that needs to repeat for each row. This is because I want to display the details in-line without further navigation and allow editing of those details.


the container is set to repeat.

Date configuration is like this:

Ignore the start date here for now.

The end date configuration is this:

This does bind the date to the date in the JSON data but it does not allow editing. In preview mode, I get this:

try to use “date and time picker”, because I checked a simple “date” element and it’s really read only. It can only be changed by changing a bound variable.


I’m not sure if this is a bug or normal behavior. But if it’s normal then it’s not a date picker, it’s date viewer :slight_smile:
@DanielL , can you please clarify this issue?

Thanks for checking this out. I had tried using the date and time picker as well but that does not let the user change the date either. The calendar does show up but when I select a date, the value does not change. Also, the date time picker does not format the date as set (it shows the time component from the JSON attribute).


image

The configuration for the date and time picker is:
Date and Time picker is set to use a date format:

The text placeholder inside the picker is what can be bound to data attribute:


image

I know the formatting can be set forcefully using JS but ideally this should be taken care of by the date and time picker. Regardless, there is still no way to change the date using the picker.

OK. I have managed to get the date picker working but it will not set the underlying variable’s value when it changes.

Here is what I have done:
DateTime Picker is set to the value of the data attribute:


The placeholder inside the datepicker is bound to the item.data.value (I assumed this item is referring to the picker itself rather than the current row item being worked on)


Preview mode now allows me to select the date and shows it on the box:


But the underlying data does not change. I have tried to set a workflow to do it but it will still not work. I guess I am not using the correct script at the correct level.

I tried adding a workflow to the Date and Time Picker itself to no avail:


Partial path formula:

Value formula:

check the video:

Thanks for taking the time to do this. My setup now is pretty much the same (workflow using the event.value) but I think the key difference is my data attribute being inside an array. I am using a partial update to only update the current item’s StartDate property as can be seen from the below data structure and the workflow configuration:

Data:

Workflow partial update variable path:

Workflow set variable to formula:

I have narrowed the issue down to the partial update. When I set the partial update formula, it creates a new variable in the current list item with the attribute name set to the outcome of the Path formula.

You need to change “path”. It’s like the address inside your object where you want to change the value.

Right now you’re passing date value as address and that’s not a valid address.

You should write in the path something like “StartDate” (or “Facilities.StartDate”) and nothing more.

I understand that’s where I am going wrong however what I am struggling with is the correct path to use.

Using a fixed string like ‘StartDate’ results in a new attribute being added to the main JSON structure as can be seen here:

Whereas what I want to do is to save the value back to where it is currently bound:

I have tried to use something fancy like this JS but it also just brings back the runtime value of StartDate and uses that as a new attribute at the top level JSON.

return variables[‘2c14dbe1-141f-4399-b73c-69efe03cb995’].Facilities [ context.item.index ].StartDate

got you.

You have an array inside “Facilities”. So, in order to make it dynamic, your JS example should work. Hard to tell why it doesn’t.

But you can write it with no-code. Your path may look like this:

Its a screenshot from this video: 2025-05-31 18-54-30

2 Likes

Thanks for all your tips. It was indeed the last bit that I was getting incorrect. I had to change the Path to this to make it work.

Thanks again!

3 Likes