Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to refer to tMap output

Hello.
I've got flow like this: 0683p000009M82g.png

Now what I want to do after tFilterRow is  depends on filter do insert or update databse but in need data from tMap_1.
I don't know how to refer in tDbOutput_3 to tMap_1 

Labels (1)
  • v7.x

7 Replies
Anonymous
Not applicable
Author

The tFlowToIterate will create a globalMap variable. If the column you want to refer to is called "myValue" and the row is called "outToSelect" (I can't quite make it out from the image) and the type is String, you would use this code to refer to the value in or after the DB component....

 

((String)globalMap.get("outToSelect.myValue))
Anonymous
Not applicable
Author

Probably it's not good solution for me.
I need this data to tDBOutput for inserting so I guess I need to have proper row coming into tDBOutput or there is an option to write insert statement manually?
So far I tried with Lookup form tDBInput to tMap and combine data from sql query and rest service.
Thanks for reply
Anonymous
Not applicable
Author

You need to connect something to your tDBOutput. What other data (apart from the value I spoke of in my last post) do you need to send there?

 

Anonymous
Not applicable
Author

I need to insert some data from rest response, some static fileds, some generated fileds (like uuid).
I prepared everything in tMap

Anonymous
Not applicable
Author

What is the tDBInput for?

Anonymous
Not applicable
Author

The flow is:
I need to call rest service for list of contracts - done.
Then for every contract I have to call rest service for contract details - done.
And then I have to check if contract (by contract number) already exists in database:
- if it doesn't exist then do insert with data from rest service and some additional fields (author, timestamp, uuid ...)
- if it exists I have to check if xmlData returned in rest response has changed since last insert (I do it by generating hash from xmlData) if not then do nothing, if it has changed I need to update old record  in database and insert new record with new data.
And problem was that after rest response and query database to check what to do I couldn't get data from rest response because I already had in flow the row from sql checking query

Anonymous
Not applicable
Author

Then you can get the data from the REST call in the way I showed above. After that you need a flow to deal with the "if exists"/"if does not exist" and to decide on the insert or update. This will likely lead to at least 2 tDBOutput components I imagine. But both will need to be triggered by a flow. They cannot be isolated. They MUST be linked to flows after the iterate link from the tFlowToIterate.

 

You need to decide upon how you are going to meet all of the possible paths of these various flows before you decide upon how to send this data. However (and I'm not suggesting this is the correct way to solve your ultimate goal), you could connect a tFlowToIterate after your tFilterRow ixedRow to your tFilterRow and have a tIterate link and then a tFixedFlowInput to that. The tFixedFlowInput would be connected to your database component where you want to insert your data. You would populate the columns of the tFixedFlowInput with the globalMap fields you require