Loading a Form from a query (not a table)

I was discussing with @Jay that some of the fields on the form were not loading. At the time @Jay said that this would be reported as a bug. Has this been sorted? It LOOKS like some of the fields are working better but I am still getting the problem on 2 date fields and a dropdown field?

I'm hoping to go live with my tool on Monday, so I wonder if there is a work around? like a JS query that populates the fields? Or do I need to do something in order to fix the fields I have?

Thanks

Jeremy

Hi @jclutterbuck

I know you already walked through part of this process with Jay but would you mind posting a screenshot of sample data being passed to that form again? When trying to repro I'm seeing both dropdown and date components populating so it may help to have some more context here.

Sure @Kabirdas , sorry, I should have done this for you before.

Hopefully this screenshot shows most of what I'm experiencing.

This form has the Initial data set to {{GetCurrentAccount.data}}. The result of which can be seen at the bottom with data for the Died and Gender fields.

In the form the data is loaded the text fields, but Died, Gender and Date of birth do not load?
The Default value is set to {{GetCurrentAccount.data.Died[0]}} in each case (as for all the other fields on the form). And the Form data key is set to Died.

You can see that the data is correctly retrieved by the query and is correctly "available" when I hover on the Default value. I wondered if it's something to do with the format? I've tried matching the format? But then I'm not sure about the Gender dropdown.

The Gender drop down options are not from a query but neither mapped or manual works. [1,2,3] -> ["Male", "Female", "Unknown"].

Any ideas?

:thinking: SQL queries usually return data as an object of arrays which may be getting picked up appropriately by some fields and not others. Can you try passing {{ formatDataAsArray(GetCurrentAccount.data) }} as the initial data for your form?

1 Like

OMG :exploding_head: how simple, worked straight away.

Thanks so much.

Jeremy