Dictionary help

How to take pairs of item in all selections.
I want to check all items in the dictionary, if the same item already exists then don’t input it into the dictionary.

{
    "selection1": [
        {
            "item": "TA0820"
        },
        {
            "qtyok": "20"
        }
    ],
    "selection2": [
        {
            "item": "TA0810"
        },
        {
            "qtyok": "15"
        }
    ],
    "selection3": [
        {
            "item": "TA0830"
        },
        {
            "qtyok": "20"
        }
    ]
}

List by walking path, make a list { walk at all level,item}

This wi give you all itema as a list

What do you mean by making it like this?

{
    "selection": [
        {
            "item": "TA0820"
        },
        {
            "qtyok": "20"
        },
        {
            "item": "TA0810"
        },
        {
            "qtyok": "15"
        },
        {
            "item": "TA0830"
        },
        {
            "qtyok": "20"
        }
    ]
}

how to copy items in many of these sections and put them in a list, please help in your beautiful block :blush:

Thank you for your help I will try it soon

I’m confused about how to apply a global variable that contains all the dictionary data to your beautiful block :blush:

I have copied your dictionary and paste into that global variable

with the help of one helper variable you can use the procedure at the triggering event and print the out on any components. else you can take into further logical sequence. (some one may give even shorter code than this)


Thank you for your help. I have tried but the results show all items are the same, I changed the local ID to the global ID that I use in the project, because I use the local ID, I get an error even though I haven’t yet or the reason.


I want to show another approach, but the results are still the same

you should not use global id, instead change into local id.

understand the logic…

you can download my block and drag into your blocks section and make changes with procedure helper variable alone.


sorry for the inconvenience but I have implemented your block into my project but I get an error message, I have tried several things but I can’t find the problem, if you are willing, you can show me your beautiful block which can provide a solution :blush:

Quit surprise to see. I have worked on the basis of json you have provided me. Make sure you too are having the same in yoir db. I was worked on the very first json which contains key as selection1,2,3… You can download my previous block and drag into yoir block part

It’s true that I think the logic is correct and have ensured that the DB is appropriate, but this error message is driving me crazy, but I’m not giving up, can you explain the meaning of this error message, maybe this can create enlightenment.

Sorry, I want to inform you that this error may be in the first “selection”, which was created to create a dictionary framework, where the dictionary can be used to add a piece of data or lots of data.

{
    "selection": [
        {
            "item": ""
        },
        {
            "qtyok": ""
        }
    ],
    "selection1": [
        {
            "item": "TA0820"
        },
        {
            "qtyok": "20"
        }
    ],
    "selection2": [
        {
            "item": "TA0810"
        },
        {
            "qtyok": "15"
        }
    ],
    "selection3": [
        {
            "item": "TA0830"
        },
        {
            "qtyok": "20"
        }
    ]
}

Yea thats correct. That item was empty. You may use if the selected item is not empty then block

But in key it will take only the value of selection1 and not selection. If possible share your sample aia here

may b its better to convert dictionary to list directly…
you will found an block in dictionary block named dictionary to list
use that block in an variable to get the list

CheckAllItem.aia (83.4 KB)

Thank you for your help I am happy to provide my aia in the hope that problem provides a solution.

companion is not working, if it works i will let you know… pls wait for some time

Status is showing online but after scan nothing comes in companion app.

i have no problem with other aia, but your aia alone doesnot open in companion… OMG!!!

wait a moment, I will redo it and test it before giving it to you