Five Stars

tRESTclient get an ID from source in the URL per row

Hi community!

 

This is my first post here, been reading here since 2 years but cannot seem to figure out this one. I really need some help. 

Ive tried both context variables and globalmaps, but the id seems to be static but i want it to change per row from the source, it does not change row by row but only selects one id in the source. 

Ive tried globalvar and tjava (context and globalmap). They all seem to pick up only one id (always the same one) for each row. The last or first one in the source. 

 

The circled area needs to change from the source, an ID row by row, right now its fixedflow as an test. 

 

My question is: whats the best solution for this? Every row uses a different URL in the trestclient as you can see in the image, the first part is static, the last part is a diffrent ID per row, each row has a unique ID. I need to parse alot of records with this job. Sometimes more than 100.000 +

1 ACCEPTED SOLUTION

Accepted Solutions
Five Stars

Re: tRESTclient get an ID from source in the URL per row

Yep.. working.... finally.. thnx my man!capture5.jpg

8 REPLIES
Twelve Stars

Re: tRESTclient get an ID from source in the URL per row

Hi,

 

You just need add tFlowToIterate component, examples below - request tickets by list, not 100 000, but many:

Screen Shot 2018-06-13 at 9.08.16 PM.png

 

Screen Shot 2018-06-13 at 9.09.45 PM.png

-----------
Five Stars

Re: tRESTclient get an ID from source in the URL per row

Seems like youre reading data, how about updating records and keep the relation between the source and the ID that youre giving in the URL? 

 

I'm trying like this but no luck yet (see screenshot) 

 

Five Stars

Re: tRESTclient get an ID from source in the URL per row

I went back to basic, the previous solution didnt work out. Ill wait for someone to come with an answer. 

To make it extra clear what i need to do, check the following screenshots. I need to use the same id from the tMAP that belongs to the rows im trying to update. Each row has a unique ID. 

 

I just dont understand how to use the flowtoiterate component with this setup. 

Twelve Stars

Re: tRESTclient get an ID from source in the URL per row

and what the problem?

You need to have tFlowToIterate between tRESTClient and tJSONFieid_2 or between tMap and tWriteJSONField_2

final goal - have a 2 rows, id for use as variable, and JSON body ... that all

Screen Shot 2018-06-14 at 08.48.21.png

 

.--+--------------------------------------------------------------.
|                            tLogRow_1                            |
|=-+-------------------------------------------------------------=|
|id|body                                                          |
|=-+-------------------------------------------------------------=|
|1 |{"our_body":{"key1":"a1","key2":"b1","key3":"c1","key4":"d1"}}|
|2 |{"our_body":{"key1":"a2","key2":"b2","key3":"c2","key4":"d2"}}|
'--+--------------------------------------------------------------'

and You have all what You need on feature steps - just iterate 1 by 1, row by row

-----------
Five Stars

Re: tRESTclient get an ID from source in the URL per row

looks promising

 

am i able to use the id in the url of trestclient like that?

 

can i see your variable? 

 

thnx for the help! 

Twelve Stars

Re: tRESTclient get an ID from source in the URL per row

it is not promising - it is just work Smiley Happy

 

Screen Shot 2018-06-15 at 09.22.50.png

 

Screen Shot 2018-06-15 at 09.22.58.png

-----------
Five Stars

Re: tRESTclient get an ID from source in the URL per row

Ah yes it got me a step closer. 

 

Now getting 500 error but i think that is finetuning with the application itself. Im gonna try to fix that now! 

 

 

Five Stars

Re: tRESTclient get an ID from source in the URL per row

Yep.. working.... finally.. thnx my man!capture5.jpg