Returning data from sub-form

I have an ODK2.0 form which contains a linked_table to a form (let’s call it the “child” form). In the child form, the user will enter a single integer called “numberOfCans” and then finalize that child form instance. How can I return this integer value back to the parent form for use for validation in the parent form? Would it be something like data(’<some_unique_form_id>.numberOfCans’)?

Hi @roundcubefour ! As you are new to the community, when you get a chance, please introduce yourself here.

I’d also encourage you to add a real picture as your avatar because it helps build community!

This is doable! You are going to need to use queries and async_assign to feed the data back up to the parent form. See here: Using ODK-X XLSX Converter — ODK-X Docs for some details and examples of async_assign and let us know any follow-up questions after that.

Thanks @elmps2018 i’ll follow it shareit app

1 Like

17

I normally create a static method on form/dialog, that I can call. This returns the success (OK-button) or failure, along with the values that needs to be filled in.

 public class ResultFromFrmMain {
     public DialogResult Result { get; set; }
     public string Field1 { get; set; }


 }

Hi @bravenine ! As you are new to the community, when you get a chance, please introduce yourself here.

I’d also encourage you to add a real picture as your avatar because it helps build community!

1 Like

I normally create a static method on form/dialog, that I can call. This returns the success (OK-button) or failure, along with the values that needs to be filled in. jiofi local html forpc.onl

The mechanism to do this has not been generalized and folded into the core software. The ‘agriculture’ form demonstrates one possible implementation of the mechanism. In this form, there are custom prompt types for asynchronous assignment of values.

1 Like

Defining a custom prompt type requires a ‘prompt_types’ sheet with the prompt type name and the datatype that the prompt type manipulates . .

1 Like