Saving an API form Repeat to session manager

New try, the first number must show:

<div class="d-flex flex-row align-items-center">
    <h6 class="cal2 cal6">Total amount of miles driven per year</h6>
    <p class="cal2 cal7">{{session1.data.value.OverallVehMilesDrivenPerYear[0].$value}}</p>
</div>
<div class="d-flex flex-row align-items-center">
    <h6 class="cal2 cal6">Estimated vehicle miles per gallon</h6>
    <p class="cal2 cal7">{{session1.data.value.OverallVehMilesPerGallon[1].$value}}</p>
</div>

Does it show? If it doesn’t show replace $value with value

nope, weird. I did both and the info shows up in the session manager but will not show on the details page.

@Teodor your turn

@ryanmorrow np, good luck :slight_smile:

@Apple thanks for your help my friend!

Please! anyone that could give me some insight to this issue… It would be greatly appreciated

@Teodor @ben @Hyperbytes

Hi @ryanmorrow, have you read Creating Multi Steps Forms?

yes. I fully understand how to create the form. The issue I am having is how to correctly save the specific data to the session manager and then pull that data. @apple and I took a crack at it and it still was not being pulling back.

I can select the fields correctly, it is just not displaying the data.

@kfawcett thank you for this article. I did not see this one. I will read through this and see if I can correct any issues. I was hoping to use the session manager but this shows the use of a variable.

I’m just curious why you need to use the session manager. If that’s causing you challenges maybe building the form steps using a multi step form might be easier?

you could be right. The form is submitting the data to the session manager until the end and then the final submit send the info to hit our server API. Im reading through this now.

Thanks again for the help. fingers crossed!

@kfawcett quick question, when using this method, does the repeat form work in the same way? Is there an snipet of code needed to tell the next button to unlock? I ask this because it states that the !input1.value : is used the associated unlock understanding.

The tutorial is showing a button being set to disabled until the fields are populated. Before you can go to the next page it wants the fields to have a value.

You may need to figure out a way to dynamically set the values since you’re using a repeat.

Taking a step back, what are you trying to accomplish? Is the repeat being used to calculate a value(s) and those are then being entered into the database as a single record or are the fields in the repeats being submitted as individual records?

As an example, I see a Ford and Toyota with miles driven and miles per gallon. Are each of those sets of values a record like below or are you combining them into one record?

MAKE | DRIVEN | MPG
Ford   19000    19
Toyota 20000    25

each is a record that is then submitted to the API calculator. So it would be if a person has 2 vehicles, the next stage of the form would be expected to have two vehicle inputs.

the form would be
vehicle type, total miles per year, estimated MPG. Right now I have it set as the person just hits the add new vehicle button and the form repeats.

here are the fields;

"NumberAutosForHousehold": 0,
    "Vehicles": [{"VehManufacturer": "Toyota",  "VehMilesDrivenPerYear": 18000.0 , "VehPctCityDriving": 80, "VehType": "Car SUV"},
               {"VehManufacturer": "Ford", "VehYear": 2020, "VehMilesPerGallon": 30, "VehMilesDrivenPerYear": 22000.0 , "VehPctCityDriving": 20}],
      "OverallVehMilesDrivenPerYear": 0,
      "OverallVehMilesPerGallon": 0,
      "NoRegularVehicleAutoMaintenance": true,

The cal is created using python on our AWS server.

Just to simplify our conversation, could all of these fields be on one page? You’re only doing multiple pages for user experience?

they could be but yes I am creating this dynamic form for user experience.

Also technically it is on one page, I am just showing and hiding each section of the form when the info is stored. In my original build once the value was stored in the session manager it would trigger the show or hide.

When using a single variable and all the values are added to that variable, when submitted to the API would it be submitted as a JSON Blob?

Is this a custom api or from a company with API documentation available online? I’m trying to understand it so I can provide your an answer.

our custom API

but I helped the guy who wrote it. And any changes needed to be made to help the front end is not a problem. I already had adjustments done to suite a few issues I have had.

Does it accept form data or do you need to format it into JSON?