Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

InputField

Hi,

Someone know how to reload value into InputField via Script?

This is my scenario:

InputTable:

InputField b;

Select a,b From Database Where condition;

At this point I modify the value of b editing it in my qlikview application (it's an input field) and eventually I save the new value into the database.

When I reload the document the value of b is the value I've edited and not, as I hope, the value read by the DB...

How can I set b to the database value each time I reload the document?

Thank you in advance for your help!

1 Solution

Accepted Solutions
Not applicable
Author

I'm not sure if that can help, but in this case you could use one field for input field and another from the same source but with another name which is not inputfield ?

Rgds,

Sébastien

View solution in original post

5 Replies
Not applicable
Author

In order to "reset" the inputfield values you'll need to use Macro function.

You should have a look at API documentation in order to set the initials values.

Regards,

Sébastien

Anonymous
Not applicable
Author

Thank you!

I know that macro can reset the input field value, but the behaviour I want achieve is:

Load:

inputfield a;

select d,a

from xxx

Each time I excecute the script I want a is read from the DB overwriting the value eventually previously inputed by the inputfield.

I think that it's may be impossible by a limitation in the inputfield usage...

Thank you,

Matteo

Not applicable
Author

I'm not sure if that can help, but in this case you could use one field for input field and another from the same source but with another name which is not inputfield ?

Rgds,

Sébastien

Anonymous
Not applicable
Author

Thank you Sèbastien!

Your tip is a good workaround! I don't know how I wasn't able to get this idea before... It's simple,but it's work and it's great.

I've set up a load table with some field and some auxiliary inputfield, I've also define a tablebox displaing all the fields loaded.

Finally I wrote a macro that do the following issues:

1) Reload the document / table with the database value

2) Reset the inputfiled field (by default the input field is empty,so I prevent any dirty value)

3) By the use of an auxiliary tablebox I set the inputfiled values to what I read from the DB and I link these values to the "dimension", so I can use the "main table box" with only "dimension" e "inputfiled" to modify the DB values and eventually store them into the DB and reload angain.

The only "trouble" I've found is that in the TableBox object row 0 contains field name and from row 1 contains I get the values, but for the SetInputFieldCell Function select with the index 0 the first InputFiled value (so one may use indexes by care)... 🙂

The problem is solved, now I'm goig to do more complex tests. Thak you for your help, you was very helpfull for me! (presenting an Input mask by InputField is better that do the input by the visual basic InputBox...).

Matteo

shahamel
Creator
Creator

Dear user,

I am asked by work to write data back into a database using an inputfield. Your answer looks perfect. If you still have your QVW.file. Could you send it to me. Or if not possible, your used code, including your used macro.

Gr. Sandeep