question

ged0313 avatar image
0 Likes"
ged0313 asked Jason Lightfoot commented

Query directly from label

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!


FlexSim 23.0.9
label
1693102614664.jpg (53.6 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

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 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

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
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

ged0313 avatar image ged0313 commented ·

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 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ ged0313 commented ·

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 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.