ID return execution of the module suite

Hi community,

I am having trouble with a problem I am having.
I’m doing an iterator to fetch all the products ordered in an API call following an order. Then I take the reference of this product to fetch the id corresponding to this product necessary to integrate it in an Invoice. So far so good, I can make my Iterator and get all the products (random number) in the second database to get the id.

It is here that it gets complicated, I would like to integrate the id of these products in a table to create the document except that the return of the call in the database to recover the id puts in hard in the variable the id. So it only makes the call on the number contained in the Make variable but not on the others.
I put you screenshots to try to clarify my point.
In the ideal I want to recover the id of the ordered products related to the second data base to integrate the whole of the ids to make the relation document of sale produced.

I hope to be as clear as possible. If you have a trick for me I’m interested.




Hi @Gauthier_Jozan ,

I personally don’t completely understand your question, but the ID within your storage module is empty because you don’t have output from the HTTP module.

If I understand correctly, you would dynamically like to map the value you get from the HTTP module.
You can do this by using the map() or get() functions (depending on the data you get back from HTTP) and dynamically trying to get the ID you are looking for.

3 Likes

Thanks Bjorn,

It’s exactly that ! I tried everything but the format that the tool sends back to me is really unretrievable i tried everything you gave me as an indication i went through transformation in text but nothing does it i can’t get a dynamic ID

{"response":{"infos":{"nbperpage":10,"nbpages":1,"pagenum":1,"nbtotal":"3"},"result":{"30898902":{"id":"30898902","corpid":"93928","status":"ok","itemid":"12583564","declid":"0","created":"2022-12-04 00:00:00","displayDate":"2022-12-04 00:00:00","qt":"10.000000000","qtBeforeMove":"1101.000000000","qtAfterMove":"1111.000000000","hasBeforeAfter":"Y","valo":"0.000000000","whid_to":"15070","linkedtype":"manual","linkedid":"15070","booking":"N","rowid":"0","notes":"","serialid":"0","item_name":"machine1","idc_name":null,"item_tradename":"Expresso Broyeur Krups YY4539FD essential grise","idc_tradename":null,"idc_id":null,"sw_label":"Entrep\u00f4t","sis_enabled":"Y","sis_valo":"NONE","totalWhQt":"1111.000000000","serial":"N\/A","docstatus":null,"docident":null,"thirdName":null,"linkedIdent":null,"purDocStatus":null,"purThirdName":null,"moveIdToDisplay":"30898902","morestock":"Y","formatted_date":"04\/12\/2022","formatted_qt":"10,00","formatted_qtBeforeMove":"1 101,00","formatted_qtAfterMove":"1 111,00","formatted_totalWhQt":"1 111,00","formatted_type":"Manuel","formatted_item_url":"?_f=catalogueitem&id=12583564&type=item&declid=0","formatted_valo":"0,00","third":"N\/A"},"30898901":{"id":"30898901","corpid":"93928","status":"ok","itemid":"12583562","declid":"0","created":"2022-12-04 00:00:00","displayDate":"2022-12-04 00:00:00","qt":"1000.000000000","qtBeforeMove":"0.000000000","qtAfterMove":"1000.000000000","hasBeforeAfter":"Y","valo":"0.000000000","whid_to":"15070","linkedtype":"manual","linkedid":null,"booking":"N","rowid":"0","notes":"","serialid":"0","item_name":"cafe2","idc_name":null,"item_tradename":"LavAzza - caf\u00e9 en grain - Qualit\u00e0 Oro","idc_tradename":null,"idc_id":null,"sw_label":"Entrep\u00f4t","sis_enabled":"Y","sis_valo":"NONE","totalWhQt":"1000.000000000","serial":"N\/A","docstatus":null,"docident":null,"thirdName":null,"linkedIdent":null,"purDocStatus":null,"purThirdName":null,"moveIdToDisplay":"30898901","morestock":"Y","formatted_date":"04\/12\/2022","formatted_qt":"1 000,00","formatted_qtBeforeMove":"0,00","formatted_qtAfterMove":"1 000,00","formatted_totalWhQt":"1 000,00","formatted_type":"Manuel","formatted_item_url":"?_f=catalogueitem&id=12583562&type=item&declid=0","formatted_valo":"0,00","third":"N\/A"},"30898897":{"id":"30898897","corpid":"93928","status":"ok","itemid":"12583564","declid":"0","created":"2022-12-04 00:00:00","displayDate":"2022-12-04 00:00:00","qt":"-1.000000000","qtBeforeMove":"1102.000000000","qtAfterMove":"1101.000000000","hasBeforeAfter":"Y","valo":"0.000000000","whid_to":"15070","linkedtype":"docinv","linkedid":"35778805","booking":"N","rowid":"0","notes":"","serialid":"0","item_name":"machine1","idc_name":null,"item_tradename":"Expresso Broyeur Krups YY4539FD essential grise","idc_tradename":null,"idc_id":null,"sw_label":"Entrep\u00f4t","sis_enabled":"Y","sis_valo":"NONE","totalWhQt":"1111.000000000","serial":"N\/A","docstatus":"ok","docident":"FACT-20221204-00011","thirdName":"Ridoret","linkedIdent":"FACT-20221204-00011","purDocStatus":null,"purThirdName":null,"moveIdToDisplay":"30898897","morestock":"N","formatted_date":"04\/12\/2022","formatted_qt":"-1,00","formatted_qtBeforeMove":"1 102,00","formatted_qtAfterMove":"1 101,00","formatted_totalWhQt":"1 111,00","formatted_type":"Facture","formatted_item_url":"?_f=catalogueitem&id=12583564&type=item&declid=0","formatted_valo":"N\/A","formatted_linked_txt":"Voir la facture","formatted_linked_url":"?_f=invoiceOverview&id=35778805","third":"Ridoret"}}},"error":"","status":"success"}

What about the keys() function @Gauthier_Jozan ?
Use that to get the keys, and once you have that you can use get() and map() to do some mapping :wink:

If you are still stuck, please be more detailed where and how you are stuck.


Screenshot_153

2 Likes

Thank you so much Bjorn for this discovery of the Keys() parameter :raised_hands: I managed to do what I wanted.

Is there a resource that summarises these funtions and their benefits?