How to transfer external parameter in to yeeflow

Hi,

I’m working on a process for staff offboarding, and I want to call data from a asset management system.
I get the parameter as below, but I don’t know how to transfer parameter to variable in yeeflow.

I store the data in a dictionary type variable, but I don’t know how to save the contents to different variables and then use them to update my data list.



04

thanks!

Hi Johnny, suggest you have response from HTTP API in the following format:
{DeviceType: “”, Model: “”, DeviceName:“”}
You can save the HTTP response to a dictionary variable, e.g. RS
And then, using it in form:
image

Or save Object attributes to a plain variable (text, number, etc)

image

Thanks Frank,

I saw, whether the response data had to be in this format ( {DeviceType: “”, Model: “”, DeviceName:“”}),it could be indentified by yeeflow?

No, it’s only an example. The attribute name should match with the ID of the varaible.

e.g. my response data format as below, so my variable ID ( field ID ) must same with red line in the picture as below?

The root level property name is assets. You should have assets in your complex type definition. And then assign the value of assets to a list variable. “total_cost” is the property in def of list variable.

Hi Frank,
After testing, it is found that the correct variable value can be obtained when the return value is as follows.



But in fact, the return value is in the following format ( Array & object), please ask how to set.

{
“assets”:[
{
“asset_tag”:“AssetTag123456789”,
“product”:{
“name”:“HP5000”
},
“product_type”:{
“internal_name”:“Workstation”
},
“name”:“CNDG2IT60XYZAA”,
“user”:{
“name”:“demo”
}
}
]
}

Additional: I want to get “AssetTag123456789”, “HP5000”, “Workstation”, “demo” and set them to variable value. Thanks!

Hi Johnny, your scenario is a little bit tricky. The attribute in assets array is an Object instead of plain text. e.g. Product name:

“product”:{
“name”:“HP5000”
}

Here’s an idea to take care this scenario:

  1. Define a variable with definition to hold the HTTP response:
    ID/Name
    assets/Assets

  2. Define a variable to hold the Asset list with definition:
    ID/Name
    asset_tag/TAG
    product/ProductObj
    productName/Product Name

  3. You need to have a task form which have a Sub list to parse the Product Name from ProductObj.

image

And remember don’t set the Sub List to readonly. Instead, you can disable Add Item and Delete Item of the Sub List and set readonly on specific columns.

  1. In workflow, use Set Variable action to assign the assets Array from HTTP response to Assets List.

I have created a simple sample workflow for you as a reference.

You can get the workflow definition from here.

Thanks Frank, and How can I import your sample file? It seems that can only import .yap files.

Hi Johnny, unzip the file you will get complexdata.ywf. You can use it in Admin Center/Workflow settings/Workflow definitions. Use “Import From Template” to overwrite any existing workflow by this file.

Hi Frank, thanks for your help. it was successful to get the value from API.
Whether it has a limit, can only get 10 records at a time? As below, my code is correct on test webpage.
When I use the same code in yeeflow it only can get 10 records and no matter how I set the “start_index” parameter, the record I get doesn’t any change, they were the same items every time.




Hi Johnny, the row_count should be the parameter defines how many items to be returned. start_index indicates the start point of the items. You may consider to increase row_count or retrieve all data in a loop.

yes, I understand what the row_count and start_index mean.
What I mean is that no matter how I change the value of these two parameters, it always returns 10 terms and always the same terms.

But you can see pictures above, I can get the all terms in test website by the same code.

Hi Johnny, you may need to check whether the parameters of HTTP Request has been set correctly.

Hi Frank, I checked my code and parameters, it is correct. please kindly see capture below.
thanks!



Hi Johnny, this requires a more detailed investigation, could you please send me the tenant Account ID with tracking no to frank@yeeflow.com.