Dynamically load data in html table from imacros

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Dynamically load data in html table from imacros

by sandip1411 on Fri May 26, 2017 12:16 am

I am working on to load data from a csv file to a table in HTML but after entering the 1st row control is not moving to 2nd row and it updates the same row again. The command is

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:0 CONTENT={{!COL1}}.

The SeqName has 0 in the front and this data has to be dynamically changed. Anyone can provide a help
sandip1411
 
Posts: 5
Joined: Fri May 26, 2017 12:12 am

Re: Dynamically load data in html table from imacros

by chivracq on Fri May 26, 2017 10:50 am

sandip1411 wrote:I am working on to load data from a csv file to a table in HTML but after entering the 1st row control is not moving to 2nd row and it updates the same row again. The command is

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:0 CONTENT={{!COL1}}.

The SeqName has 0 in the front and this data has to be dynamically changed. Anyone can provide a help

CIM...! :mrgreen:
(always mention your FCI when you open a Thread, read my Sig..., many Commands are not implemented for all Browsers/Versions...)

And try to select the correct Sub-Forum when you open a Thread, the 'iMacros for FF' is meant for Scripts that fail in FF only but work in other Browsers or if you use a '.js' Script... (Correct Sub-Forum would have been the 'General' one, but no need to duplicate now...)

For your Qt, simply use a Variable for the "0" part I would think, if I understand correctly that it needs to get incremented, based on '!LOOP' for example if you loop your Script...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5988
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Dynamically load data in html table from imacros

by sandip1411 on Mon May 29, 2017 10:45 pm

Hi chivracq,
Thanks for your reply. I am very new to iMacros and to this site. The version I am using is iMacros for Firefox 9.0.3. I could not find the iMacro version.
My script is below

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !DATASOURCE CN119-AccSeqAssignment2019.csv
SET !LOOP 2
TAG POS=1 TYPE=IMG ATTR=SRC:http://raesfs.intranet.local:8035/OA_HTML/cabo/images/skyros/new_ena.png
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:0 CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:StartDate:0 CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:EndDate:0 CONTENT={{!COL3}}

I could not understand your statement of how to use the loop in SeqName:0. It would be great if you can provide the details in the above script. I am taking the data from a CSV file that has 3 columns.
I am not sure if am using the correct version of iMacros. I simply downloaded that from firefox Addons.

Thanks
Sandip
sandip1411
 
Posts: 5
Joined: Fri May 26, 2017 12:12 am

Re: Dynamically load data in html table from imacros

by chivracq on Tue May 30, 2017 1:03 am

sandip1411 wrote:Hi chivracq,
Thanks for your reply. I am very new to iMacros and to this site. The version I am using is
Code: Select all
iMacros for Firefox 9.0.3.
I could not find the iMacro version.
My script is below

Code: Select all
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !DATASOURCE CN119-AccSeqAssignment2019.csv
SET !LOOP 2
TAG POS=1 TYPE=IMG ATTR=SRC:http://raesfs.intranet.local:8035/OA_HTML/cabo/images/skyros/new_ena.png
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:0 CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:StartDate:0 CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:EndDate:0 CONTENT={{!COL3}}


I could not understand your statement of how to use the loop in SeqName:0. It would be great if you can provide the details in the above script. I am taking the data from a CSV file that has 3 columns.
I am not sure if am using the correct version of iMacros. I simply downloaded that from firefox Addons.

Thanks
Sandip

"I could not find the iMacro version."
=> Well, you did, as v9.0.3 for FF is your Version of iMacros for FF...
But FF Version and OS are still missing, even if they probably won't play a role in your Case but I won't react next time you open a Thread (or post for the first time in some existing Thread like you did in this Thread) if you don't mention directly those 3 Versions...
=> Probable FCI:
iMacros for FF v9.0.3, FF53...?, OS...?

v9.0.3 for FF should be "OK" for your "Needs" as your Script doesn't do anything "fancy" but it is a little buggy and limited compared to some previous Version (v8.9.7 for FF) which is more stable (and still works on FF53).

OK, you don't post what your Statements should become exactly for the 2nd and next Rows of Data, but if I understand correctly that for example your Statement for Row_1:
Code: Select all
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:0 CONTENT={{!COL1}}

... should become for Row_2:
Code: Select all
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:1 CONTENT={{!COL1}}


=> Then you can use for example:
Code: Select all
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !DATASOURCE CN119-AccSeqAssignment2019.csv
SET !LOOP 2

SET Row_Nb {{!LOOP}}
ADD Row_Nb -2
TAG POS=1 TYPE=IMG ATTR=SRC:http://raesfs.intranet.local:8035/OA_HTML/cabo/images/skyros/new_ena.png
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:{{Row_Nb}} CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:StartDate:{{Row_Nb}} CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:EndDate:{{Row_Nb}} CONTENT={{!COL3}}

That's it...! You can use '!VAR1' instead of 'Row_Nb' if you prefer for your Var, I usually prefer to give them some "meaningful" Names...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5988
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Dynamically load data in html table from imacros

by sandip1411 on Wed May 31, 2017 1:40 am

Hi,
Thanks for replying to my mail and providing the solution. Your solution has resolved the issue of moving to next line in html page but new issue has come up.

My CSV file has multiple rows and using the new script the 1st row is copied from csv and placed in the html form every time and 2nd or subsequent row data from csv is not picked up. This time I have used IE version of iMacros details of which are provided below

OS- Windows 8
IE version - 11.0.9600
iMacro version - VERSION BUILD=11.5.499.3066

The imacro used

VERSION BUILD=11.5.499.3066
TAB T=1
SET !DATASOURCE CN119-AccSeqAssignment2019.csv
SET !LOOP 2

SET Row_Nb {{!LOOP}}
ADD Row_Nb -2
TAG POS=1 TYPE=IMG ATTR=SRC:http://raesfs.intranet.local:8035/OA_HTML/cabo/images/skyros/new_ena.png
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:{{Row_Nb}} CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:StartDate:{{Row_Nb}} CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:EndDate:{{Row_Nb}} CONTENT={{!COL3}}

The data in CSV file ( 3 columns in CSV. html is able to generate 4 rows but only 1st row data is copied to each row)

XX_ACC_SEQ_CN_PL_119_201902_ALL,01-Feb-2019,28-Feb-2019
XX_ACC_SEQ_CN_PL_119_201903_ALL,01-MAR-2019,31-MAR-2019
XX_ACC_SEQ_CN_PL_119_201903_ALL,01-APR-2019,30-APR-2019
XX_ACC_SEQ_CN_PL_119_201903_ALL,01-MAY-2019,31-MAY-2019

Thanks in advance for your help.
I am very thankful to your patience
Sandip
sandip1411
 
Posts: 5
Joined: Fri May 26, 2017 12:12 am

Re: Dynamically load data in html table from imacros

by sandip1411 on Wed May 31, 2017 2:36 am

Hi,
Please ignore my previous note as I am able to resolve the issue with a loop for datasource line.

Thanks for your help again
Sandip
sandip1411
 
Posts: 5
Joined: Fri May 26, 2017 12:12 am

Re: Dynamically load data in html table from imacros

by chivracq on Wed May 31, 2017 7:15 am

sandip1411 wrote:Hi,
Thanks for replying to my mail and providing the solution. Your solution has resolved the issue of moving to next line in html page but new issue has come up.

My CSV file has multiple rows and using the new script the 1st row is copied from csv and placed in the html form every time and 2nd or subsequent row data from csv is not picked up. This time I have used IE version of iMacros details of which are provided below

Code: Select all
OS- Windows 8
IE version - 11.0.9600
iMacro version - VERSION BUILD=11.5.499.3066


The imacro used

Code: Select all
VERSION BUILD=11.5.499.3066
TAB T=1
SET !DATASOURCE CN119-AccSeqAssignment2019.csv
SET !LOOP 2

SET Row_Nb {{!LOOP}}
ADD Row_Nb -2
TAG POS=1 TYPE=IMG ATTR=SRC:http://raesfs.intranet.local:8035/OA_HTML/cabo/images/skyros/new_ena.png
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:SeqName:{{Row_Nb}} CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:StartDate:{{Row_Nb}} CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:DefaultFormName ATTR=ID:N58:EndDate:{{Row_Nb}} CONTENT={{!COL3}}

The data in CSV file ( 3 columns in CSV. html is able to generate 4 rows but only 1st row data is copied to each row)

XX_ACC_SEQ_CN_PL_119_201902_ALL,01-Feb-2019,28-Feb-2019
XX_ACC_SEQ_CN_PL_119_201903_ALL,01-MAR-2019,31-MAR-2019
XX_ACC_SEQ_CN_PL_119_201903_ALL,01-APR-2019,30-APR-2019
XX_ACC_SEQ_CN_PL_119_201903_ALL,01-MAY-2019,31-MAY-2019


Thanks in advance for your help.
I am very thankful to your patience
Sandip

Ah-ah...!, yep, funny...! Hum, at least for me, oops...! :oops:

You make the same "Mistake" like this other User in this Thread... I let you find out the Explanation/Solution by yourself... (Nearly strange to see 2 Users making the same Mistake in one week, I don't think I ever saw any Thread(s) on the Forum about this...)
But hum, interesting then, if you say that your current Script actually works in FF with v9.0.3, but fails in IE with v11.5, that confirms a bit my "Surprise" Remark in the other Thread about "Default Behaviour"...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5988
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Dynamically load data in html table from imacros

by chivracq on Wed May 31, 2017 8:05 am

sandip1411 wrote:Hi,
Please ignore my previous note as I am able to resolve the issue with a loop for datasource line.

Thanks for your help again
Sandip

Ah OK..., hum, I had missed this 2nd Post of yours...
=> Yep...!: '!DATASOURCE_LINE' ah-ah...!
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5988
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to iMacros for Firefox

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 9 guests

-->