Submitted by Muadib on 2017/12/28 09:45
I'm trying to automate data entry into InfoQube. Using http://sqlitebrowser.org/ I created db with 3 rows: id, start, end. I added 10 entries to it, using sqlite3 python module. When I use following code in sync file, I get error: "3 fields found for mapping, RecordID field not found (cd is not a field in your IQBase).
 
 
<ConnectionString>

Database=D:\Inbox\db1.sqlite;

</ConnectionString>

<FieldMap>
    [id]    cd
    [name]    Started Timer
    [number]    Ended Timer
</FieldMap>

<RecordIDField>cd</RecordIDField>
 
Anyone can help?
 
P.S. I have created field called "cd" in InfoQube
 

Comments

Muadib

2017/12/28 11:01

In reply to by Pierre_Admin

Hi Pierre!
 
Thanks for quick response.
 
Your simple solution is actually more complex than what I'm trying to do.
 
I created new db using python "sqlite3" module, with 3 rows, and added 1 entry,
 
In previous file i forgot to add driver statement in connectionstring, new files looks like:
 
<ConnectionString>

Driver={SQLite3 ODBC Driver};

Database=D:\Inbox\SQLiteDatabaseBrowserPortable\Data\dbase.sqlite;

</ConnectionString>


<FieldMap>
[id]    cd
[startedtime]    Started Timer
[endedtimer]    Ended Timer
</FieldMap>



<RecordIDField>cd</RecordIDField>
 
But I'm still getting error, this time it says that "3 fields found for mapping. cannot connect to server (Subscript out of range)"
 
Thanks for help!
 
 

Pierre_Admin

2017/12/28 11:08

In reply to by Muadib

Hi,
 
For one thing, you're missing <source>SELECT ...</source>
 
To import you need:
  1. Connection
  2. FieldMap
  3. Source
  4. RecordIDField
  5. RecordStatus
  6. RecordDateField
  7. LastUpdate
  8. RecordParentField (opt)
  9. RecordParentValueField (opt)
 
Pierre_Admin
IQ Designer
 

Muadib

2017/12/28 11:27

In reply to by Pierre_Admin

Ok, so i added all fields, and it still tells me that subscript is out of range....
 
Thanks for being patient with me!
 
Code:
 
<ConnectionString>
Driver={SQLite3 ODBC Driver};
Database=D:\Inbox\tes.db;
</ConnectionString>

<FieldMap>
[id]    cd
[startedtime]    Started Timer
[endedtimer]    Ended Timer
</FieldMap>

<Source>
SELECT tabs.id, tabs.startedtime, tabs.endedtimer
FROM tabs
</source>

<RecordIDField>cd</RecordIDField>
<RecordStatus>IDStatusSQL ADD UPDATE</RecordStatus>
<RecordDateField>DateUpdate</RecordDateField>
<LastUpdate>20017-12-27 07:00:00</LastUpdate>

Pierre_Admin

2017/12/28 12:24

In reply to by Muadib

Hi,
 
The RecordStatus line is a bit picky... it needs this format:
FieldName   ADD   UPDATE
 
But you must use TAB between the 3 parts
 
 
Pierre_Admin
IQ Designer
 

Muadib

2017/12/30 10:23

In reply to by Pierre_Admin

Hi Pierre,
 
It works perfectly now. Thanks.
 
Just 1 more question - I created grid for routines i do often, there are few items i would like to hide on certain days, say Monday or Friday.
 
I was thinking about creating 2 columns; 1 with list of weekdays and 2nd checkmark column.
 
Could you help me with equation that would check what weekday today is, then check if it marches with 1st column value, and if it does mark 2nd column.
 
Thanks for help.

Pierre_Admin

2017/12/30 11:33

In reply to by Muadib

Great news !
 
Version v107Pre did somewhat improve this somewhat
 
For the day of the week, checkout the Day field in the sample app:
In Options, enter something like:
 
<source>SELECT ItemID, Format([Date],"ddd") AS Day FROM ¯qDate;</source>
 
Pierre_Admin
IQ Designer
 

Muadib

2017/12/30 14:30

In reply to by Pierre_Admin

You misunderstood me :)
 
I have created 2 columns: 1st one is list of weeks day names (Sunday, Monday.....) 2nd one is simple boolean checkmark.
 
What i want to archive: If today is Monday and item has value in 1st column called Monday, check 2nd field.
 
I have no experience in excel or coding, so sorry if this is something very basic.
 
Thanks!

Muadib

2017/12/31 07:44

In reply to by Pierre_Admin

So I created simple function that gets current date formated as ddd, then returns true if it matches with string in another field:
 
function isToday(dDate)
  Dim todaysdate
  Set todaysdate = String.Format("{ddd}", DateTime.Now)
  if (dDate) = (todaysdate) then isToday=true else isToday=false
end function
 
On field i want to be checked I added this equation in "Row Equations":  
 
 
=isToday( [not_show_routine_day] )
 
Yet it still doesn't work. Any help?