Query directly from label

Query directly from label

ged0313
Not applicable
32 Views
4 Replies
Message 1 of 5

Query directly from label

ged0313
Not applicable

[ FlexSim 23.0.9 ]

Hi! I have a question about using the labels in my process flow activity “pull from list”. I already set different label on the item that is going to ship.

My way to grab the label now is to create an expression to store the label and use Where syntax to search for it. But I find it can work well in some model, but some model not. I was wondering if i want to use the label on the item in Query directly what syntax shall i use. (that is not creating expression)

1693102614664.jpg

Thank you for your help!


0 Likes
Accepted solutions (1)
33 Views
4 Replies
Replies (4)
Message 2 of 5

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

The entry on the list is referred to using 'value' so if that's an item and you want to check the label 'groupName' your query can use

value.groupName=2
0 Likes
Message 3 of 5

ged0313
Not applicable

Thank you so much! It is exactly how i set the value now. But it came up with the same error showing label does not exist. So I wanna ask how can i fix this. Or if there is a way that i can use the label without grbbing from the list. Thank you!


My model: 一車新想法_autosave.fsm

0 Likes
Message 4 of 5

jason_lightfootVL7B4
Autodesk
Autodesk

We've told you this in previous posts, you need to add ? to your names and this field should in theory be dynamic since you set it after you push the item to the list:

if (value.groupName? == 1)
    return 1;
else if (value.groupName?== 2)
    return 2;
else if (value.groupName? == 3)
    return 3;
else
    return value.groupName?;

But actually with those values you can see you can just use:

return value.groupName?   

without all the if/else etc.


0 Likes
Message 5 of 5

jason_lightfootVL7B4
Autodesk
Autodesk

Hi @ged0313, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes