Some values are not shown in the next module

I am connected to the iCount app and i am trying to do the next scenario :

the issue is :
I am getting from module search documents all the required parameters as well as the “docnum” and “doctype” parameter but when i am trying to set them to variables through module “set multiple variables” the parameters “docnum” and "doctype are not displayed there is an array document of lists but it is not as the variables previously and it returns empty view in the attached image below :

I think there is some bug in the iCount app
Hope maybe someone has a workaround :slight_smile:

Hey! Welcome to the Make community!

Can you give more details about what you want to store in Set Multiple Variables. Here we see that you mapped the clientid coming from the first module.

Apparently the Search Documents module will return an array with multiple fields, and since it’s an array, you have to add the index of element to pick, or you need an iterator to extract each individual document. But it depends on what you want to achieve.

Can you then give more details about what you want to set in the Set Multiple Variables?

Cheers

Benjamin

2 Likes

Thanks for the reply :slight_smile:
And you are correct i did not attach what i am getting from search module

the bold parameters is what i wish to store in the set variable module (after the text i m attching again the screen shot of the set variable module that is missing the bold parameters for reference

[
{
“doctype”: “invoice”,
** “docnum”: “425”,**
“dateissued”: “2017-05-01”,
“timeissued”: “2017-05-01T06:39:24+00:00”,
“client_id”: “112”,
“custom_client_id”: “”,
“currency_id”: 5,
“currency_code”: “ILS”,
“currency”: “ש"ח”,
“rate”: 1,
“total”: “3182.40”,
“is_cancellation”: 0,
“is_cancelled”: 0,
“status”: 1,
IMTLENGTH”: 3,
IMTINDEX”: 1
},
{
“doctype”: “receipt”,
“docnum”: “434”,
“dateissued”: “2017-06-02”,
“timeissued”: “2017-06-04T09:21:44+00:00”,
“client_id”: “112”,
“custom_client_id”: “”,
“currency_id”: 5,
“currency_code”: “ILS”,
“currency”: “ש"ח”,
“rate”: 1,
“total”: “3182.4”,
“is_cancellation”: 0,
“is_cancelled”: 0,
“status”: 1,
IMTLENGTH”: 3,
IMTINDEX”: 2
},
{
“doctype”: “offer”,
“docnum”: “6040”,
“dateissued”: “2017-04-20”,
“timeissued”: “2017-04-23T21:08:29+00:00”,
“client_id”: “112”,
“custom_client_id”: “”,
“currency_id”: 5,
“currency_code”: “ILS”,
“currency”: “ש"ח”,
“rate”: 1,
“total”: “3182.40”,
“is_cancellation”: 0,
“is_cancelled”: 0,
“status”: 1,
IMTLENGTH”: 3,
IMTINDEX”: 3
}
]

The parameters i want are doctype and “docnum” i don’t know why they are not in bold that’s why i am replying again :slight_smile:

Hello,

thanks for the document! it’s very useful!
I hope I understood correctly and that my answer will be the one you expect :sweat_smile:

In Make, for some modules, we labeled the fields to make them more easy to read and understand.

For instance here, we see “Document Type”, but is should actually be “doctype”. In the pop-up you showed us, can you hover your mouse on “Document Type”? It should make appear a little pop-up that shows the “row name” of the field. (test also with Document Number).
It’s the same for IMTINDEX and IMTLENGTH, in the pop-up, it’s “Bundle order position” and “Total number of bundles”.

These 4 variables are those you want to extract.

In case I answer wrongly, can you also make a screenshot of the output of “Search Documents”, clicking on its log (the bubble with 22)?
And one last question. Since “List of documents” is an array, it looks like iCount can return you multiple documents in each bundle. Do you want to extract the first document of each bundle, or do you also want each and every documents? If it’s the second option, you may need to use an Iterator…

Benjamin

2 Likes

I hope i did it correctly attaching here both screenshots




I think i understand but then i still think there is a mismatch because in module of search documents the parameters are not in the array of list of documents( if i understand correctly) which leads to module set variable that is displaying it as array so maybe that is why i am getting an empty array ?

yesterday i have talked with iCount and they checked requests i have made from make i the modules they are returning an array called list of results array not empty with the needed values

Oh, I see what’s happening. There’s a change that needs to be done by iCount in their App I believe, because the Output “declared” is different than the one “returned”…

Let’s try some trick :sweat_smile:

Go to your set multiple variables, add a variable called what you want (ex: doc type), then go to “Variable value”, and type: {{4.doctype}}. (don’t copy/paste, type it)
Make should immediately detect you are referring to a variable. Here, we say "for module stamped 4 (it’s the little number we see on the right of the app name in the scenario), get variable with raw name ‘doctype’.

It should look like this

Run and see if you pick the value for each operation.

If it works, you can do the same for docnum.
For Total number of bundles and bundle order position, it should work when you drag and drop the fields that appear in the pop-up.

Benjamin

2 Likes

WOW that worked! awesome thanks a lot!!!
I just want to understand why did we refer with number 4? cause in is the first in the bundle so how did you know that it should be number 4?

1 Like

Sure, let me explain.

When you add a new module in a scenario, it’s automatically assigned a unique number. Even if you delete a module and recreate one, the number is always incremented.
In your scenario, we can see that when you added “search document”, it was assigned number 4. This is the little number that appears beside the name of the module in a little square.

It’s use by Make to reference any variable from other modules. When you drag and drop a field for a mapping, it automatically gets the module “unique number” and adds the raw name of the field you are mapping.
Under the hood, each variable is set with this {{moduleNumber.variable}}.

I hope it clarifies it :slight_smile:

I’m super happy it works for you now!

Benjamin

2 Likes

Ohhh i see it know ,
That was super clear thanks a lot :grinning: :grinning:

3 Likes